From 8b3d782e20146413b623159ad280aaeb3360aed4 Mon Sep 17 00:00:00 2001 From: Dylan <99700808+dkilgore-eightfold@users.noreply.github.com> Date: Mon, 1 May 2023 13:01:40 -0700 Subject: [PATCH] feat: linkbutton: add link button component (#607) * feat: linkbutton: add link button component * chore: linkbutton: address pr feedback consolidating button and linkbutton by variant * chore: linkbutton: push prettier changes * chore: linkbutton: removes redundant enum * chore: linkbutton: removes missing type * chore: linkbutton: update stories --- src/components/Button/Button.stories.tsx | 99 +- src/components/Button/Button.test.tsx | 79 +- .../Button/{BaseButton.tsx => Button.tsx} | 59 +- src/components/Button/Button.types.ts | 36 +- .../Button/DefaultButton/DefaultButton.tsx | 27 +- .../Button/NeutralButton/NeutralButton.tsx | 24 +- src/components/Button/Nudge/Hooks/useNudge.ts | 17 +- .../Button/PrimaryButton/PrimaryButton.tsx | 25 +- .../SecondaryButton/SecondaryButton.tsx | 27 +- .../Button/SplitButton/SplitButton.tsx | 49 +- .../Button/SystemUIButton/SystemUIButton.tsx | 25 +- .../TwoStateButton/TwoStateButton.stories.tsx | 4 +- .../Button/TwoStateButton/TwoStateButton.tsx | 3 +- src/components/Button/index.ts | 2 +- .../LinkButton/LinkButton.stories.tsx | 235 ++++ src/components/LinkButton/LinkButton.test.tsx | 333 +++++ src/components/LinkButton/LinkButton.tsx | 335 +++++ src/components/LinkButton/LinkButton.types.ts | 158 +++ .../__snapshots__/LinkButton.test.tsx.snap | 195 +++ src/components/LinkButton/index.ts | 2 + .../LinkButton/linkbutton.module.scss | 1128 +++++++++++++++++ src/components/OcBase/Base.types.ts | 5 + .../__snapshots__/Pagination.test.tsx.snap | 8 +- .../PersistentBar/PersistentBar.stories.tsx | 110 +- .../PersistentBar/PersistentBar.tsx | 11 +- .../PersistentBar/PersistentBar.types.ts | 4 +- .../Select/__snapshots__/Select.test.tsx.snap | 18 +- src/octuple.ts | 27 +- 28 files changed, 2733 insertions(+), 312 deletions(-) rename src/components/Button/{BaseButton.tsx => Button.tsx} (86%) create mode 100644 src/components/LinkButton/LinkButton.stories.tsx create mode 100644 src/components/LinkButton/LinkButton.test.tsx create mode 100644 src/components/LinkButton/LinkButton.tsx create mode 100644 src/components/LinkButton/LinkButton.types.ts create mode 100644 src/components/LinkButton/__snapshots__/LinkButton.test.tsx.snap create mode 100644 src/components/LinkButton/index.ts create mode 100644 src/components/LinkButton/linkbutton.module.scss diff --git a/src/components/Button/Button.stories.tsx b/src/components/Button/Button.stories.tsx index a4c678bc1..39d2dc6f4 100644 --- a/src/components/Button/Button.stories.tsx +++ b/src/components/Button/Button.stories.tsx @@ -2,17 +2,13 @@ import React from 'react'; import { Stories } from '@storybook/addon-docs'; import { ComponentStory, ComponentMeta } from '@storybook/react'; import { - BaseButton, + Button, ButtonIconAlign, ButtonShape, ButtonSize, ButtonTextAlign, + ButtonVariant, ButtonWidth, - DefaultButton, - NeutralButton, - PrimaryButton, - SecondaryButton, - SystemUIButton, } from './'; import { IconName } from '../Icon'; import { NudgeAnimation } from './Nudge'; @@ -154,63 +150,34 @@ export default { ], control: { type: 'radio' }, }, - theme: { - options: ['light', 'dark'], - control: { type: 'inline-radio' }, + variant: { + options: [ + ButtonVariant.Default, + ButtonVariant.Neutral, + ButtonVariant.Primary, + ButtonVariant.Secondary, + ButtonVariant.SystemUI, + ], + control: { type: 'radio' }, }, }, -} as ComponentMeta; - -const Primary_Button_Story: ComponentStory = (args) => ( - -); - -export const Primary = Primary_Button_Story.bind({}); -export const Counter = Primary_Button_Story.bind({}); +} as ComponentMeta; -const Secondary_Button_Story: ComponentStory = ( - args -) => ; - -export const Secondary = Secondary_Button_Story.bind({}); - -const Default_Button_Story: ComponentStory = (args) => ( - +const Button_Story: ComponentStory = (args) => ( +