@agility/plenum-ui 2.0.0-rc47 → 2.0.0-rc48

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.
Files changed (139) hide show
  1. package/.eslintrc.json +6 -6
  2. package/.prettierrc +13 -13
  3. package/.storybook/Layout.jsx +12 -12
  4. package/.storybook/head.tsx +4 -4
  5. package/.storybook/main.ts +18 -18
  6. package/.storybook/manager-head.html +1 -1
  7. package/.storybook/manager.ts +25 -25
  8. package/.storybook/plenumTheme.ts +8 -8
  9. package/.storybook/preview-head.html +3 -3
  10. package/.storybook/preview.tsx +28 -28
  11. package/.vscode/settings.json +3 -3
  12. package/README.md +271 -271
  13. package/app/globals.css +99 -99
  14. package/app/head.tsx +59 -59
  15. package/app/layout.tsx +28 -28
  16. package/app/page.tsx +7 -7
  17. package/build.js +45 -45
  18. package/dist/index.d.ts +230 -230
  19. package/dist/index.js.map +1 -1
  20. package/local.sh +100 -100
  21. package/next.config.js +8 -8
  22. package/package.json +83 -83
  23. package/pages/api/hello.ts +13 -13
  24. package/postcss.config.js +6 -6
  25. package/rollup.config.mjs +41 -41
  26. package/scripts/create-component.js +97 -97
  27. package/stories/Introduction.mdx +314 -314
  28. package/stories/assets/stackalt.svg +1 -1
  29. package/stories/atoms/Avatar/Avatar.stories.tsx +96 -96
  30. package/stories/atoms/Avatar/Avatar.tsx +123 -123
  31. package/stories/atoms/Avatar/index.ts +3 -3
  32. package/stories/atoms/badges/Badge.tsx +127 -127
  33. package/stories/atoms/badges/Pill/Pill.stories.tsx +75 -75
  34. package/stories/atoms/badges/Rounded/Rounded.stories.tsx +75 -75
  35. package/stories/atoms/badges/index.ts +3 -3
  36. package/stories/atoms/buttons/Button/Alternative/Alternative.stories.ts +86 -86
  37. package/stories/atoms/buttons/Button/Button.tsx +232 -232
  38. package/stories/atoms/buttons/Button/Danger/Danger.stories.ts +90 -90
  39. package/stories/atoms/buttons/Button/Primary/Primary.stories.ts +97 -97
  40. package/stories/atoms/buttons/Button/Secondary/Secondary.stories.ts +93 -93
  41. package/stories/atoms/buttons/Button/defaultArgs.ts +9 -9
  42. package/stories/atoms/buttons/Button/index.ts +3 -3
  43. package/stories/atoms/buttons/Capsule/Alternative/Alternative.stories.ts +27 -27
  44. package/stories/atoms/buttons/Capsule/Capsule.tsx +88 -88
  45. package/stories/atoms/buttons/Capsule/Danger/Danger.stories.ts +27 -27
  46. package/stories/atoms/buttons/Capsule/Primary/Primary.stories.ts +27 -27
  47. package/stories/atoms/buttons/Capsule/Secondary/Secondary.stories.ts +27 -27
  48. package/stories/atoms/buttons/Capsule/index.ts +3 -3
  49. package/stories/atoms/buttons/FloatingActionButton/FloatingActionButton.stories.tsx +15 -15
  50. package/stories/atoms/buttons/FloatingActionButton/FloatingActionButton.tsx +22 -22
  51. package/stories/atoms/buttons/FloatingActionButton/index.tsx +3 -3
  52. package/stories/atoms/buttons/index.ts +4 -4
  53. package/stories/atoms/crumb/Crumb.stories.tsx +18 -18
  54. package/stories/atoms/crumb/Crumb.tsx +22 -22
  55. package/stories/atoms/crumb/index.tsx +3 -3
  56. package/stories/atoms/icons/DynamicIcon.stories.ts +43 -43
  57. package/stories/atoms/icons/DynamicIcon.tsx +90 -90
  58. package/stories/atoms/icons/IconWithShadow.stories.ts +43 -43
  59. package/stories/atoms/icons/IconWithShadow.tsx +16 -16
  60. package/stories/atoms/icons/TablerIcon.tsx +22 -22
  61. package/stories/atoms/icons/index.tsx +14 -14
  62. package/stories/atoms/icons/tablerIconNames.ts +4336 -4336
  63. package/stories/atoms/index.ts +46 -46
  64. package/stories/atoms/loaders/Loader.stories.ts +15 -15
  65. package/stories/atoms/loaders/Loader.tsx +21 -21
  66. package/stories/atoms/loaders/NProgress/RadialProgress.stories.tsx +19 -19
  67. package/stories/atoms/loaders/NProgress/RadialProgress.tsx +74 -74
  68. package/stories/atoms/loaders/NProgress/index.ts +3 -3
  69. package/stories/atoms/loaders/index.ts +4 -4
  70. package/stories/index.ts +136 -136
  71. package/stories/molecules/index.ts +51 -51
  72. package/stories/molecules/inputs/InputCounter/InputCounter.stories.tsx +18 -18
  73. package/stories/molecules/inputs/InputCounter/InputCounter.tsx +24 -24
  74. package/stories/molecules/inputs/InputCounter/index.tsx +3 -3
  75. package/stories/molecules/inputs/InputField/InputField.stories.tsx +29 -29
  76. package/stories/molecules/inputs/InputField/InputField.tsx +96 -96
  77. package/stories/molecules/inputs/InputField/index.tsx +3 -3
  78. package/stories/molecules/inputs/InputLabel/InputLabel.stories.tsx +19 -19
  79. package/stories/molecules/inputs/InputLabel/InputLabel.tsx +45 -45
  80. package/stories/molecules/inputs/InputLabel/index.tsx +3 -3
  81. package/stories/molecules/inputs/NestedInputButton/NestedInputButton.stories.tsx +52 -52
  82. package/stories/molecules/inputs/NestedInputButton/NestedInputButton.tsx +64 -64
  83. package/stories/molecules/inputs/NestedInputButton/index.tsx +3 -3
  84. package/stories/molecules/inputs/TextInput/TextInput.stories.tsx +32 -32
  85. package/stories/molecules/inputs/TextInput/TextInput.tsx +165 -165
  86. package/stories/molecules/inputs/TextInput/index.tsx +5 -5
  87. package/stories/molecules/inputs/checkbox/Checkbox.stories.ts +23 -23
  88. package/stories/molecules/inputs/checkbox/Checkbox.tsx +98 -98
  89. package/stories/molecules/inputs/checkbox/index.ts +3 -3
  90. package/stories/molecules/inputs/combobox/ComboBox.stories.ts +41 -41
  91. package/stories/molecules/inputs/combobox/ComboBox.tsx +185 -185
  92. package/stories/molecules/inputs/combobox/index.ts +3 -3
  93. package/stories/molecules/inputs/index.ts +38 -38
  94. package/stories/molecules/inputs/radio/Radio.stories.ts +27 -27
  95. package/stories/molecules/inputs/radio/Radio.tsx +92 -92
  96. package/stories/molecules/inputs/radio/index.ts +3 -3
  97. package/stories/molecules/inputs/select/Select.stories.ts +23 -23
  98. package/stories/molecules/inputs/select/Select.tsx +100 -100
  99. package/stories/molecules/inputs/select/index.ts +3 -3
  100. package/stories/molecules/inputs/textArea/TextArea.stories.ts +22 -22
  101. package/stories/molecules/inputs/textArea/TextArea.tsx +158 -158
  102. package/stories/molecules/inputs/textArea/index.ts +3 -3
  103. package/stories/molecules/inputs/toggleSwitch/ToggleSwitch.stories.tsx +118 -118
  104. package/stories/molecules/inputs/toggleSwitch/ToggleSwitch.tsx +81 -81
  105. package/stories/molecules/inputs/toggleSwitch/index.ts +3 -3
  106. package/stories/molecules/tabs/Tabs.stories.tsx +18 -18
  107. package/stories/molecules/tabs/Tabs.tsx +22 -22
  108. package/stories/molecules/tabs/index.tsx +2 -2
  109. package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.stories.tsx +30 -30
  110. package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.tsx +66 -66
  111. package/stories/organisms/AnimatedLabelInput/index.tsx +3 -3
  112. package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.stories.tsx +26 -26
  113. package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.tsx +61 -61
  114. package/stories/organisms/AnimatedLabelTextArea/index.tsx +3 -3
  115. package/stories/organisms/ButtonDropdown/ButtonDropdown.stories.tsx +125 -125
  116. package/stories/organisms/ButtonDropdown/ButtonDropdown.tsx +86 -86
  117. package/stories/organisms/ButtonDropdown/index.tsx +3 -3
  118. package/stories/organisms/DropdownComponent/Dropdown.stories.tsx +73 -73
  119. package/stories/organisms/DropdownComponent/DropdownComponent.tsx +346 -346
  120. package/stories/organisms/DropdownComponent/dropdownItems.ts +122 -122
  121. package/stories/organisms/DropdownComponent/index.ts +4 -4
  122. package/stories/organisms/EmptySectionPlaceholder/EmptySectionPlaceholder.stories.tsx +76 -76
  123. package/stories/organisms/EmptySectionPlaceholder/EmptySectionPlaceholder.tsx +52 -52
  124. package/stories/organisms/EmptySectionPlaceholder/index.tsx +4 -4
  125. package/stories/organisms/FormInputWithAddons/FormInputWithAddons.stories.tsx +29 -29
  126. package/stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx +145 -145
  127. package/stories/organisms/FormInputWithAddons/index.tsx +3 -3
  128. package/stories/organisms/TextInputSelect/InputSelect.tsx +59 -59
  129. package/stories/organisms/TextInputSelect/TextInputSelect.stories.tsx +33 -33
  130. package/stories/organisms/TextInputSelect/TextInputSelect.tsx +186 -186
  131. package/stories/organisms/TextInputSelect/index.tsx +3 -3
  132. package/stories/organisms/index.ts +27 -27
  133. package/tailwind.config.js +192 -192
  134. package/tsconfig.json +29 -29
  135. package/tsconfig.lib.json +25 -25
  136. package/utils/types.d.ts +2 -2
  137. package/utils/types.ts +3 -3
  138. package/utils/useId.d.ts +1 -1
  139. package/utils/useId.tsx +16 -16
@@ -1,97 +1,97 @@
1
- const fs = require("fs")
2
- const path = require("path")
3
- const readline = require("readline").createInterface({
4
- input: process.stdin,
5
- output: process.stdout
6
- })
7
-
8
- const componentName = process.argv[2]
9
- const destinationDir = process.argv[3]
10
-
11
- if (!componentName || !destinationDir) {
12
- console.error("Please provide a component name and destination directory")
13
- process.exit(1)
14
- }
15
-
16
- // Ensure the component name is in PascalCase
17
- if (!/^[A-Z][A-Za-z0-9]*$/.test(componentName)) {
18
- console.error("Component name must be in PascalCase")
19
- process.exit(1)
20
- }
21
-
22
- const directoryPath = path.join("stories", destinationDir, componentName)
23
-
24
- if (fs.existsSync(directoryPath)) {
25
- readline.question(`Directory ${directoryPath} already exists. Do you want to overwrite it? (yes/no) `, (answer) => {
26
- if (answer.toLowerCase() !== "yes") {
27
- console.log("Operation cancelled")
28
- readline.close()
29
- process.exit(1)
30
- } else {
31
- createFiles()
32
- console.log(`Component ${componentName} created successfully at ${directoryPath}`)
33
- readline.close()
34
- process.exit(0) // exit successfully
35
- }
36
- })
37
- } else {
38
- createFiles()
39
- console.log(`Component ${componentName} created successfully at ${directoryPath}`)
40
- process.exit(0) // exit successfully
41
- }
42
-
43
- function createFiles() {
44
- fs.mkdirSync(directoryPath, { recursive: true })
45
-
46
- const componentContent = `
47
- import React from "react"
48
- import EmptySectionPlaceholder from "@/stories/organisms/EmptySectionPlaceholder"
49
-
50
- export interface I${componentName}Props {}
51
-
52
- const ${componentName}: React.FC<I${componentName}Props> = ({}) => {
53
- return (
54
- <EmptySectionPlaceholder
55
- {...{
56
- icon: {
57
- icon: "IconCode"
58
- },
59
- mutedText: "Coming Soon! 🚧",
60
- primaryMessage: "We're working on this component. Be sure to check back soon!",
61
- actions: []
62
- }}
63
- />
64
- )
65
- };
66
-
67
- export default ${componentName};
68
- `
69
- fs.writeFileSync(path.join(directoryPath, `${componentName}.tsx`), componentContent)
70
-
71
- const storyContent = `
72
- import type { Meta, StoryObj } from "@storybook/react"
73
- import ${componentName}, { I${componentName}Props } from "./${componentName}"
74
-
75
- const meta: Meta<typeof ${componentName}> = {
76
- title: "Design System/${destinationDir}/${componentName}",
77
- component: ${componentName},
78
- tags: ["autodocs"],
79
- argTypes: {}
80
- }
81
-
82
- export default meta
83
- type Story = StoryObj<typeof ${componentName}>
84
- export const Default${componentName}Story: Story = {
85
- args: {
86
-
87
- }
88
- }
89
- `
90
- fs.writeFileSync(path.join(directoryPath, `${componentName}.stories.tsx`), storyContent)
91
-
92
- const indexContent = `
93
- export { default } from './${componentName}';
94
- export * from './${componentName}';
95
- `
96
- fs.writeFileSync(path.join(directoryPath, "index.tsx"), indexContent)
97
- }
1
+ const fs = require("fs")
2
+ const path = require("path")
3
+ const readline = require("readline").createInterface({
4
+ input: process.stdin,
5
+ output: process.stdout
6
+ })
7
+
8
+ const componentName = process.argv[2]
9
+ const destinationDir = process.argv[3]
10
+
11
+ if (!componentName || !destinationDir) {
12
+ console.error("Please provide a component name and destination directory")
13
+ process.exit(1)
14
+ }
15
+
16
+ // Ensure the component name is in PascalCase
17
+ if (!/^[A-Z][A-Za-z0-9]*$/.test(componentName)) {
18
+ console.error("Component name must be in PascalCase")
19
+ process.exit(1)
20
+ }
21
+
22
+ const directoryPath = path.join("stories", destinationDir, componentName)
23
+
24
+ if (fs.existsSync(directoryPath)) {
25
+ readline.question(`Directory ${directoryPath} already exists. Do you want to overwrite it? (yes/no) `, (answer) => {
26
+ if (answer.toLowerCase() !== "yes") {
27
+ console.log("Operation cancelled")
28
+ readline.close()
29
+ process.exit(1)
30
+ } else {
31
+ createFiles()
32
+ console.log(`Component ${componentName} created successfully at ${directoryPath}`)
33
+ readline.close()
34
+ process.exit(0) // exit successfully
35
+ }
36
+ })
37
+ } else {
38
+ createFiles()
39
+ console.log(`Component ${componentName} created successfully at ${directoryPath}`)
40
+ process.exit(0) // exit successfully
41
+ }
42
+
43
+ function createFiles() {
44
+ fs.mkdirSync(directoryPath, { recursive: true })
45
+
46
+ const componentContent = `
47
+ import React from "react"
48
+ import EmptySectionPlaceholder from "@/stories/organisms/EmptySectionPlaceholder"
49
+
50
+ export interface I${componentName}Props {}
51
+
52
+ const ${componentName}: React.FC<I${componentName}Props> = ({}) => {
53
+ return (
54
+ <EmptySectionPlaceholder
55
+ {...{
56
+ icon: {
57
+ icon: "IconCode"
58
+ },
59
+ mutedText: "Coming Soon! 🚧",
60
+ primaryMessage: "We're working on this component. Be sure to check back soon!",
61
+ actions: []
62
+ }}
63
+ />
64
+ )
65
+ };
66
+
67
+ export default ${componentName};
68
+ `
69
+ fs.writeFileSync(path.join(directoryPath, `${componentName}.tsx`), componentContent)
70
+
71
+ const storyContent = `
72
+ import type { Meta, StoryObj } from "@storybook/react"
73
+ import ${componentName}, { I${componentName}Props } from "./${componentName}"
74
+
75
+ const meta: Meta<typeof ${componentName}> = {
76
+ title: "Design System/${destinationDir}/${componentName}",
77
+ component: ${componentName},
78
+ tags: ["autodocs"],
79
+ argTypes: {}
80
+ }
81
+
82
+ export default meta
83
+ type Story = StoryObj<typeof ${componentName}>
84
+ export const Default${componentName}Story: Story = {
85
+ args: {
86
+
87
+ }
88
+ }
89
+ `
90
+ fs.writeFileSync(path.join(directoryPath, `${componentName}.stories.tsx`), storyContent)
91
+
92
+ const indexContent = `
93
+ export { default } from './${componentName}';
94
+ export * from './${componentName}';
95
+ `
96
+ fs.writeFileSync(path.join(directoryPath, "index.tsx"), indexContent)
97
+ }