@arbor-education/design-system.components 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#134](https://github.com/arbor-education/design-system.components/pull/134) [`b8b0d2e`](https://github.com/arbor-education/design-system.components/commit/b8b0d2eb5fb39878cbe62fdd30604bf5ca070920) Thanks [@AmeeMorris](https://github.com/AmeeMorris)! - MIS-69496 make sure Button stories reference the variant prop, not the old type prop
8
+
3
9
  ## 0.5.0
4
10
 
5
11
  ### Minor Changes
@@ -0,0 +1,50 @@
1
+ import type { StoryObj } from '@storybook/react-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ component: import("react").ForwardRefExoticComponent<Omit<import("react").PropsWithChildren<import("./Button").ButtonProps>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
5
+ parameters: {
6
+ layout: string;
7
+ };
8
+ tags: string[];
9
+ argTypes: {
10
+ variant: {
11
+ control: "select";
12
+ options: string[];
13
+ description: string;
14
+ };
15
+ size: {
16
+ control: "select";
17
+ options: string[];
18
+ description: string;
19
+ };
20
+ disabled: {
21
+ control: "boolean";
22
+ description: string;
23
+ };
24
+ children: {
25
+ control: "text";
26
+ description: string;
27
+ };
28
+ onClick: {
29
+ action: string;
30
+ };
31
+ };
32
+ };
33
+ export default meta;
34
+ type Story = StoryObj<typeof meta>;
35
+ export declare const Primary: Story;
36
+ export declare const PrimaryIconOnly: Story;
37
+ export declare const Secondary: Story;
38
+ export declare const SecondaryIconOnly: Story;
39
+ export declare const Tertiary: Story;
40
+ export declare const TertiaryIconOnly: Story;
41
+ export declare const Dropdown: Story;
42
+ export declare const PrimaryDestructive: Story;
43
+ export declare const PrimaryDestructiveIconOnly: Story;
44
+ export declare const SecondaryDestructive: Story;
45
+ export declare const SecondaryDestructiveIconOnly: Story;
46
+ export declare const TextLink: Story;
47
+ export declare const SmallPrimary: Story;
48
+ export declare const SmallSecondary: Story;
49
+ export declare const Disabled: Story;
50
+ //# sourceMappingURL=Button.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCqB,CAAC;AAEhC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAGnC,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAM7B,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,KAKvB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAO/B,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,KAKtB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAO9B,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,KAKtB,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,KAKhC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,KAOxC,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,KAKlC,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,KAO1C,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,KAKtB,CAAC;AAGF,eAAO,MAAM,YAAY,EAAE,KAK1B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAK5B,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,KAKtB,CAAC"}
@@ -0,0 +1,151 @@
1
+ import { Button } from './Button';
2
+ const meta = {
3
+ title: 'Components/Button',
4
+ component: Button,
5
+ parameters: {
6
+ layout: 'centered',
7
+ },
8
+ tags: ['autodocs'],
9
+ argTypes: {
10
+ variant: {
11
+ control: 'select',
12
+ options: [
13
+ 'primary',
14
+ 'secondary',
15
+ 'tertiary',
16
+ 'primary-destructive',
17
+ 'secondary-destructive',
18
+ 'text-link',
19
+ 'dropdown',
20
+ ],
21
+ description: 'Button variant',
22
+ },
23
+ size: {
24
+ control: 'select',
25
+ options: ['M', 'S'],
26
+ description: 'Button size',
27
+ },
28
+ disabled: {
29
+ control: 'boolean',
30
+ description: 'Disable the button',
31
+ },
32
+ children: {
33
+ control: 'text',
34
+ description: 'Button text',
35
+ },
36
+ onClick: {
37
+ action: 'clicked',
38
+ },
39
+ },
40
+ };
41
+ export default meta;
42
+ // Primary button
43
+ export const Primary = {
44
+ args: {
45
+ variant: 'primary',
46
+ children: 'Button Text',
47
+ size: 'M',
48
+ },
49
+ };
50
+ export const PrimaryIconOnly = {
51
+ args: {
52
+ ...Primary.args,
53
+ children: null,
54
+ iconRightName: 'info',
55
+ },
56
+ };
57
+ // Secondary button
58
+ export const Secondary = {
59
+ args: {
60
+ ...Primary.args,
61
+ variant: 'secondary',
62
+ },
63
+ };
64
+ export const SecondaryIconOnly = {
65
+ args: {
66
+ ...Primary.args,
67
+ variant: 'secondary',
68
+ children: null,
69
+ iconRightName: 'info',
70
+ },
71
+ };
72
+ // Tertiary button
73
+ export const Tertiary = {
74
+ args: {
75
+ ...Primary.args,
76
+ variant: 'tertiary',
77
+ },
78
+ };
79
+ export const TertiaryIconOnly = {
80
+ args: {
81
+ ...Primary.args,
82
+ children: null,
83
+ iconRightName: 'info',
84
+ variant: 'tertiary',
85
+ },
86
+ };
87
+ // Dropdown button
88
+ export const Dropdown = {
89
+ args: {
90
+ ...Primary.args,
91
+ variant: 'dropdown',
92
+ },
93
+ };
94
+ // Primary destructive button
95
+ export const PrimaryDestructive = {
96
+ args: {
97
+ ...Primary.args,
98
+ variant: 'primary-destructive',
99
+ },
100
+ };
101
+ export const PrimaryDestructiveIconOnly = {
102
+ args: {
103
+ ...Primary.args,
104
+ children: null,
105
+ iconRightName: 'info',
106
+ variant: 'primary-destructive',
107
+ },
108
+ };
109
+ // Secondary destructive button
110
+ export const SecondaryDestructive = {
111
+ args: {
112
+ ...Primary.args,
113
+ variant: 'secondary-destructive',
114
+ },
115
+ };
116
+ export const SecondaryDestructiveIconOnly = {
117
+ args: {
118
+ ...Primary.args,
119
+ children: null,
120
+ iconRightName: 'info',
121
+ variant: 'secondary-destructive',
122
+ },
123
+ };
124
+ // Text link button
125
+ export const TextLink = {
126
+ args: {
127
+ ...Primary.args,
128
+ variant: 'text-link',
129
+ },
130
+ };
131
+ // Small buttons
132
+ export const SmallPrimary = {
133
+ args: {
134
+ ...Primary.args,
135
+ size: 'S',
136
+ },
137
+ };
138
+ export const SmallSecondary = {
139
+ args: {
140
+ ...Secondary.args,
141
+ size: 'S',
142
+ },
143
+ };
144
+ // Disabled button
145
+ export const Disabled = {
146
+ args: {
147
+ ...Primary.args,
148
+ disabled: true,
149
+ },
150
+ };
151
+ //# sourceMappingURL=Button.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.stories.js","sourceRoot":"","sources":["../../../src/components/button/Button.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,mBAAmB;IAC1B,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;KACnB;IACD,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE;gBACP,SAAS;gBACT,WAAW;gBACX,UAAU;gBACV,qBAAqB;gBACrB,uBAAuB;gBACvB,WAAW;gBACX,UAAU;aACX;YACD,WAAW,EAAE,gBAAgB;SAC9B;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,CAAC,GA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IAC7B,IAAI,EAAE;QACJ,GAAG,OAAO,CAAC,IAAI;QACf,QAAQ,EAAE,IAAI;KACf;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbor-education/design-system.components",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "The component library for the design system (the baby)",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -9,7 +9,7 @@ const meta = {
9
9
  },
10
10
  tags: ['autodocs'],
11
11
  argTypes: {
12
- type: {
12
+ variant: {
13
13
  control: 'select',
14
14
  options: [
15
15
  'primary',
@@ -20,7 +20,7 @@ const meta = {
20
20
  'text-link',
21
21
  'dropdown',
22
22
  ],
23
- description: 'Button type/variant',
23
+ description: 'Button variant',
24
24
  },
25
25
  size: {
26
26
  control: 'select',
@@ -47,7 +47,7 @@ type Story = StoryObj<typeof meta>;
47
47
  // Primary button
48
48
  export const Primary: Story = {
49
49
  args: {
50
- type: 'primary',
50
+ variant: 'primary',
51
51
  children: 'Button Text',
52
52
  size: 'M',
53
53
  },
@@ -65,14 +65,14 @@ export const PrimaryIconOnly: Story = {
65
65
  export const Secondary: Story = {
66
66
  args: {
67
67
  ...Primary.args,
68
- type: 'secondary',
68
+ variant: 'secondary',
69
69
  },
70
70
  };
71
71
 
72
72
  export const SecondaryIconOnly: Story = {
73
73
  args: {
74
74
  ...Primary.args,
75
- type: 'secondary',
75
+ variant: 'secondary',
76
76
  children: null,
77
77
  iconRightName: 'info',
78
78
  },
@@ -82,7 +82,7 @@ export const SecondaryIconOnly: Story = {
82
82
  export const Tertiary: Story = {
83
83
  args: {
84
84
  ...Primary.args,
85
- type: 'tertiary',
85
+ variant: 'tertiary',
86
86
  },
87
87
  };
88
88
 
@@ -91,7 +91,7 @@ export const TertiaryIconOnly: Story = {
91
91
  ...Primary.args,
92
92
  children: null,
93
93
  iconRightName: 'info',
94
- type: 'tertiary',
94
+ variant: 'tertiary',
95
95
  },
96
96
  };
97
97
 
@@ -99,7 +99,7 @@ export const TertiaryIconOnly: Story = {
99
99
  export const Dropdown: Story = {
100
100
  args: {
101
101
  ...Primary.args,
102
- type: 'dropdown',
102
+ variant: 'dropdown',
103
103
  },
104
104
  };
105
105
 
@@ -107,7 +107,7 @@ export const Dropdown: Story = {
107
107
  export const PrimaryDestructive: Story = {
108
108
  args: {
109
109
  ...Primary.args,
110
- type: 'primary-destructive',
110
+ variant: 'primary-destructive',
111
111
  },
112
112
  };
113
113
 
@@ -116,7 +116,7 @@ export const PrimaryDestructiveIconOnly: Story = {
116
116
  ...Primary.args,
117
117
  children: null,
118
118
  iconRightName: 'info',
119
- type: 'primary-destructive',
119
+ variant: 'primary-destructive',
120
120
  },
121
121
  };
122
122
 
@@ -124,7 +124,7 @@ export const PrimaryDestructiveIconOnly: Story = {
124
124
  export const SecondaryDestructive: Story = {
125
125
  args: {
126
126
  ...Primary.args,
127
- type: 'secondary-destructive',
127
+ variant: 'secondary-destructive',
128
128
  },
129
129
  };
130
130
 
@@ -133,7 +133,7 @@ export const SecondaryDestructiveIconOnly: Story = {
133
133
  ...Primary.args,
134
134
  children: null,
135
135
  iconRightName: 'info',
136
- type: 'secondary-destructive',
136
+ variant: 'secondary-destructive',
137
137
  },
138
138
  };
139
139
 
@@ -141,7 +141,7 @@ export const SecondaryDestructiveIconOnly: Story = {
141
141
  export const TextLink: Story = {
142
142
  args: {
143
143
  ...Primary.args,
144
- type: 'text-link',
144
+ variant: 'text-link',
145
145
  },
146
146
  };
147
147