@flightlesslabs/dodo-ui 0.6.5 → 0.6.6

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 (165) hide show
  1. package/dist/index.d.ts +6 -4
  2. package/dist/stories/Home.mdx +4 -6
  3. package/dist/stories/components/Form/Button/Button.stories.svelte +16 -37
  4. package/dist/stories/components/Form/Button/Button.svelte +44 -46
  5. package/dist/stories/components/Form/Button/Button.svelte.d.ts +10 -9
  6. package/dist/stories/components/Form/Button/Color/Color.stories.svelte +23 -48
  7. package/dist/stories/components/Form/Button/Events/Events.stories.svelte +1 -7
  8. package/dist/stories/components/Form/Button/IconButton/IconButton.stories.svelte +4 -12
  9. package/dist/stories/components/Form/Button/Roundness/Roundness.stories.svelte +5 -31
  10. package/dist/stories/components/Form/Button/Size/Size.stories.svelte +3 -9
  11. package/dist/stories/components/Form/Button/Variant/Variant.stories.svelte +5 -8
  12. package/dist/stories/components/Form/FormControl/FormControl.stories.svelte +11 -12
  13. package/dist/stories/components/Form/FormControl/FormControl.svelte +3 -8
  14. package/dist/stories/components/Form/Label/Label.stories.svelte +1 -11
  15. package/dist/stories/components/Form/Label/Label.svelte +2 -4
  16. package/dist/stories/components/Form/Label/Label.svelte.d.ts +0 -2
  17. package/dist/stories/components/Form/Message/Color/Color.stories.svelte +9 -9
  18. package/dist/stories/components/Form/Message/Message.stories.svelte +5 -13
  19. package/dist/stories/components/Form/Message/Message.svelte +4 -9
  20. package/dist/stories/components/Form/Message/Message.svelte.d.ts +3 -5
  21. package/dist/stories/components/Form/Message/Size/Size.stories.svelte +3 -5
  22. package/dist/stories/components/Form/PasswordInput/Events/Events.stories.svelte +8 -72
  23. package/dist/stories/components/Form/PasswordInput/PasswordInput.stories.svelte +5 -3
  24. package/dist/stories/components/Form/PasswordInput/PasswordInput.svelte +4 -4
  25. package/dist/stories/components/Form/PasswordInput/PasswordInput.svelte.d.ts +3 -2
  26. package/dist/stories/components/Form/PasswordInput/Roundness/Roundness.stories.svelte +4 -4
  27. package/dist/stories/components/Form/PasswordInput/WithIcon/WithIcon.stories.svelte +2 -2
  28. package/dist/stories/components/Form/SimpleSelect/Events/Events.stories.svelte +3 -30
  29. package/dist/stories/components/Form/SimpleSelect/Roundness/Roundness.stories.svelte +4 -4
  30. package/dist/stories/components/Form/SimpleSelect/SimpleSelect.stories.svelte +4 -6
  31. package/dist/stories/components/Form/SimpleSelect/SimpleSelect.svelte +4 -4
  32. package/dist/stories/components/Form/SimpleSelect/SimpleSelect.svelte.d.ts +3 -2
  33. package/dist/stories/components/Form/SimpleSelect/WithIcon/WithIcon.stories.svelte +2 -2
  34. package/dist/stories/components/Form/TextInput/Events/Events.stories.svelte +7 -63
  35. package/dist/stories/components/Form/TextInput/Roundness/Roundness.stories.svelte +4 -4
  36. package/dist/stories/components/Form/TextInput/TextInput.stories.svelte +6 -4
  37. package/dist/stories/components/Form/TextInput/TextInput.svelte +12 -5
  38. package/dist/stories/components/Form/TextInput/TextInput.svelte.d.ts +4 -2
  39. package/dist/stories/components/Form/TextInput/WithIcon/WithIcon.stories.svelte +4 -4
  40. package/dist/stories/components/Layout/Paper/Color/Color.stories.svelte +63 -0
  41. package/dist/stories/components/Layout/Paper/Color/Color.stories.svelte.d.ts +26 -0
  42. package/dist/stories/components/Layout/Paper/Paper.stories.svelte +25 -16
  43. package/dist/stories/components/Layout/Paper/Paper.svelte +211 -14
  44. package/dist/stories/components/Layout/Paper/Paper.svelte.d.ts +18 -7
  45. package/dist/stories/components/Layout/Paper/Roundness/Roundness.stories.svelte +8 -13
  46. package/dist/stories/components/Layout/Paper/Shadow/Shadow.stories.svelte +6 -24
  47. package/dist/stories/components/Layout/Paper/utils/scss/mixins.scss +46 -0
  48. package/dist/stories/developer tools/Intro.mdx +2 -0
  49. package/dist/stories/developer tools/components/InputEnclosure/InputEnclosure.stories.svelte +5 -5
  50. package/dist/stories/developer tools/components/InputEnclosure/InputEnclosure.svelte +14 -14
  51. package/dist/stories/developer tools/components/InputEnclosure/InputEnclosure.svelte.d.ts +3 -2
  52. package/dist/stories/developer tools/components/InputEnclosure/Roundness/Roundness.stories.svelte +4 -4
  53. package/dist/stories/developer tools/components/InputEnclosure/WithIcon/WithIcon.stories.svelte +4 -4
  54. package/dist/stories/developer tools/components/UtilityButton/Size/Size.stories.svelte +3 -3
  55. package/dist/stories/developer tools/components/UtilityButton/UtilityButton.stories.svelte +4 -3
  56. package/dist/stories/developer tools/components/UtilityButton/UtilityButton.svelte +3 -3
  57. package/dist/stories/developer tools/components/UtilityButton/UtilityButton.svelte.d.ts +1 -1
  58. package/dist/stories/{philosophy/Colors/Colors.mdx → developer tools/philosophy/Colors/Colors.mdx } +2 -2
  59. package/dist/stories/{philosophy/Colors/Swatches/Palette.svelte → developer tools/philosophy/Colors/Swatches/Palette.svelte } +1 -1
  60. package/dist/stories/{philosophy/Colors/Swatches/Swatch.svelte → developer tools/philosophy/Colors/Swatches/Swatch.svelte } +1 -1
  61. package/dist/stories/{philosophy/Colors/Swatches/Swatches.svelte → developer tools/philosophy/Colors/Swatches/Swatches.svelte } +1 -1
  62. package/dist/stories/{philosophy/Colors/utils/color.js → developer tools/philosophy/Colors/utils/color.js } +1 -1
  63. package/dist/stories/{philosophy/Themes.mdx → developer tools/philosophy/Themes.mdx } +1 -1
  64. package/dist/styles/_colors.css +44 -44
  65. package/dist/styles/_components.css +6 -3
  66. package/dist/styles/_shadow.css +13 -20
  67. package/dist/styles/_space.css +7 -0
  68. package/dist/styles/global.css +1 -0
  69. package/dist/types/colors.d.ts +7 -0
  70. package/dist/types/colors.js +10 -0
  71. package/dist/types/roundness.d.ts +3 -0
  72. package/dist/types/roundness.js +1 -0
  73. package/dist/types/shadow.d.ts +3 -0
  74. package/dist/types/shadow.js +1 -0
  75. package/dist/types/size.d.ts +3 -0
  76. package/dist/types/size.js +1 -0
  77. package/dist/types/weight.d.ts +3 -0
  78. package/dist/types/weight.js +1 -0
  79. package/package.json +26 -24
  80. package/src/lib/index.ts +13 -8
  81. package/src/lib/stories/components/Form/Button/Button.svelte +30 -31
  82. package/src/lib/stories/components/Form/FormControl/FormControl.svelte +2 -7
  83. package/src/lib/stories/components/Form/Label/Label.svelte +1 -6
  84. package/src/lib/stories/components/Form/Message/Message.svelte +9 -16
  85. package/src/lib/stories/components/Form/PasswordInput/PasswordInput.svelte +7 -6
  86. package/src/lib/stories/components/Form/SimpleSelect/SimpleSelect.svelte +7 -6
  87. package/src/lib/stories/components/Form/TextInput/TextInput.svelte +16 -6
  88. package/src/lib/stories/components/Layout/Paper/Paper.svelte +151 -23
  89. package/src/lib/stories/components/Layout/Paper/utils/scss/mixins.scss +46 -0
  90. package/src/lib/stories/developer tools/components/InputEnclosure/InputEnclosure.svelte +17 -16
  91. package/src/lib/stories/developer tools/components/UtilityButton/UtilityButton.svelte +4 -4
  92. package/src/lib/stories/{philosophy/Colors/Swatches/Palette.svelte → developer tools/philosophy/Colors/Swatches/Palette.svelte } +1 -1
  93. package/src/lib/stories/{philosophy/Colors/Swatches/Swatch.svelte → developer tools/philosophy/Colors/Swatches/Swatch.svelte } +1 -1
  94. package/src/lib/stories/{philosophy/Colors/Swatches/Swatches.svelte → developer tools/philosophy/Colors/Swatches/Swatches.svelte } +1 -1
  95. package/src/lib/stories/{philosophy/Colors/utils/color.ts → developer tools/philosophy/Colors/utils/color.ts } +1 -1
  96. package/src/lib/styles/_colors.css +44 -44
  97. package/src/lib/styles/_components.css +6 -3
  98. package/src/lib/styles/_shadow.css +13 -20
  99. package/src/lib/styles/_space.css +7 -0
  100. package/src/lib/styles/global.css +1 -0
  101. package/src/lib/types/colors.ts +16 -0
  102. package/src/lib/types/roundness.ts +3 -0
  103. package/src/lib/types/shadow.ts +3 -0
  104. package/src/lib/types/size.ts +3 -0
  105. package/src/lib/types/weight.ts +3 -0
  106. package/dist/types.d.ts +0 -5
  107. package/dist/types.js +0 -1
  108. package/src/lib/stories/Home.mdx +0 -61
  109. package/src/lib/stories/assets/dark-theme-toggle.png +0 -0
  110. package/src/lib/stories/components/Form/Button/Button.stories.svelte +0 -82
  111. package/src/lib/stories/components/Form/Button/Color/Color.stories.svelte +0 -68
  112. package/src/lib/stories/components/Form/Button/Events/Events.stories.svelte +0 -42
  113. package/src/lib/stories/components/Form/Button/IconButton/IconButton.stories.svelte +0 -51
  114. package/src/lib/stories/components/Form/Button/Roundness/Roundness.stories.svelte +0 -49
  115. package/src/lib/stories/components/Form/Button/Size/Size.stories.svelte +0 -22
  116. package/src/lib/stories/components/Form/Button/Variant/Variant.stories.svelte +0 -21
  117. package/src/lib/stories/components/Form/FormControl/FormControl.stories.svelte +0 -29
  118. package/src/lib/stories/components/Form/Label/Label.stories.svelte +0 -23
  119. package/src/lib/stories/components/Form/Message/Color/Color.stories.svelte +0 -36
  120. package/src/lib/stories/components/Form/Message/Message.stories.svelte +0 -35
  121. package/src/lib/stories/components/Form/Message/Size/Size.stories.svelte +0 -24
  122. package/src/lib/stories/components/Form/PasswordInput/Events/Events.stories.svelte +0 -174
  123. package/src/lib/stories/components/Form/PasswordInput/PasswordInput.stories.svelte +0 -57
  124. package/src/lib/stories/components/Form/PasswordInput/Roundness/Roundness.stories.svelte +0 -20
  125. package/src/lib/stories/components/Form/PasswordInput/Size/Size.stories.svelte +0 -16
  126. package/src/lib/stories/components/Form/PasswordInput/WithIcon/WithIcon.stories.svelte +0 -31
  127. package/src/lib/stories/components/Form/SimpleSelect/Events/Events.stories.svelte +0 -79
  128. package/src/lib/stories/components/Form/SimpleSelect/Roundness/Roundness.stories.svelte +0 -24
  129. package/src/lib/stories/components/Form/SimpleSelect/SimpleSelect.stories.svelte +0 -64
  130. package/src/lib/stories/components/Form/SimpleSelect/Size/Size.stories.svelte +0 -20
  131. package/src/lib/stories/components/Form/SimpleSelect/WithIcon/WithIcon.stories.svelte +0 -36
  132. package/src/lib/stories/components/Form/TextInput/Events/Events.stories.svelte +0 -153
  133. package/src/lib/stories/components/Form/TextInput/Roundness/Roundness.stories.svelte +0 -21
  134. package/src/lib/stories/components/Form/TextInput/Size/Size.stories.svelte +0 -17
  135. package/src/lib/stories/components/Form/TextInput/TextInput.stories.svelte +0 -41
  136. package/src/lib/stories/components/Form/TextInput/WithIcon/WithIcon.stories.svelte +0 -47
  137. package/src/lib/stories/components/Layout/Paper/Paper.stories.svelte +0 -41
  138. package/src/lib/stories/components/Layout/Paper/Roundness/Roundness.stories.svelte +0 -30
  139. package/src/lib/stories/components/Layout/Paper/Shadow/Shadow.stories.svelte +0 -42
  140. package/src/lib/stories/developer tools/Intro.mdx +0 -7
  141. package/src/lib/stories/developer tools/components/InputEnclosure/InputEnclosure.stories.svelte +0 -38
  142. package/src/lib/stories/developer tools/components/InputEnclosure/Roundness/Roundness.stories.svelte +0 -20
  143. package/src/lib/stories/developer tools/components/InputEnclosure/Size/Size.stories.svelte +0 -16
  144. package/src/lib/stories/developer tools/components/InputEnclosure/WithIcon/WithIcon.stories.svelte +0 -47
  145. package/src/lib/stories/developer tools/components/UtilityButton/Size/Size.stories.svelte +0 -27
  146. package/src/lib/stories/developer tools/components/UtilityButton/UtilityButton.stories.svelte +0 -33
  147. package/src/lib/stories/philosophy/Colors/Colors.mdx +0 -43
  148. package/src/lib/stories/philosophy/Colors/Colors.stories.svelte +0 -22
  149. package/src/lib/stories/philosophy/Colors/Opacity.stories.svelte +0 -11
  150. package/src/lib/stories/philosophy/Themes.mdx +0 -23
  151. package/src/lib/types.ts +0 -6
  152. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Colors.stories.svelte +0 -0
  153. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Colors.stories.svelte.d.ts +0 -0
  154. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Colors.svelte +0 -0
  155. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Colors.svelte.d.ts +0 -0
  156. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Opacity.stories.svelte +0 -0
  157. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Opacity.stories.svelte.d.ts +0 -0
  158. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Opacity.svelte +0 -0
  159. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Opacity.svelte.d.ts +0 -0
  160. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Swatches/Palette.svelte.d.ts +0 -0
  161. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Swatches/Swatch.svelte.d.ts +0 -0
  162. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/Swatches/Swatches.svelte.d.ts +0 -0
  163. /package/dist/stories/{philosophy → developer tools/philosophy}/Colors/utils/color.d.ts +0 -0
  164. /package/src/lib/stories/{philosophy → developer tools/philosophy}/Colors/Colors.svelte +0 -0
  165. /package/src/lib/stories/{philosophy → developer tools/philosophy}/Colors/Opacity.svelte +0 -0
@@ -1,39 +1,32 @@
1
1
  :root {
2
- --dodo-shadow-color: #0000000d;
2
+ --dodo-shadow-color: rgba(0, 0, 0, 0.11);
3
3
  }
4
4
 
5
- .dodo-shadow-1x {
6
- --dodo-shadow: 0 1px var(--dodo-shadow-color);
7
- box-shadow: var(--dodo-shadow);
8
- }
9
-
10
- .dodo-shadow-2x {
11
- --dodo-shadow: 0 1px 2px 0 var(--dodo-shadow-color);
12
- box-shadow: var(--dodo-shadow);
5
+ .dodo-theme--dark {
6
+ --dodo-shadow-color: rgba(0, 0, 0, 0.09);
13
7
  }
14
8
 
15
- .dodo-shadow-3x {
16
- --dodo-shadow: 0 1px 3px 0 var(--dodo-shadow-color);
9
+ .dodo-shadow-1 {
10
+ --dodo-shadow: 0 1px 3px var(--dodo-shadow-color), 0 1px 2px var(--dodo-shadow-color);
17
11
  box-shadow: var(--dodo-shadow);
18
12
  }
19
13
 
20
- .dodo-shadow-4x {
21
- --dodo-shadow: 0 4px 6px -1px var(--dodo-shadow-color), 0 2px 4px -2px var(--dodo-shadow-color);
14
+ .dodo-shadow-2 {
15
+ --dodo-shadow: 0 3px 6px var(--dodo-shadow-color), 0 3px 6px var(--dodo-shadow-color);
22
16
  box-shadow: var(--dodo-shadow);
23
17
  }
24
18
 
25
- .dodo-shadow-5x {
26
- --dodo-shadow: 0 10px 15px -3px var(--dodo-shadow-color), 0 4px 6px -4px var(--dodo-shadow-color);
19
+ .dodo-shadow-3 {
20
+ --dodo-shadow: 0 6px 10px var(--dodo-shadow-color), 0 5px 17px var(--dodo-shadow-color);
27
21
  box-shadow: var(--dodo-shadow);
28
22
  }
29
23
 
30
- .dodo-shadow-6x {
31
- --dodo-shadow:
32
- 0 20px 25px -5px var(--dodo-shadow-color), 0 8px 10px -6px var(--dodo-shadow-color);
24
+ .dodo-shadow-4 {
25
+ --dodo-shadow: 0 10px 18px var(--dodo-shadow-color), 0 6px 10px var(--dodo-shadow-color);
33
26
  box-shadow: var(--dodo-shadow);
34
27
  }
35
28
 
36
- .dodo-shadow-7x {
37
- --dodo-shadow: 0 25px 50px -12px var(--dodo-shadow-color);
29
+ .dodo-shadow-5 {
30
+ --dodo-shadow: 0 14px 28px var(--dodo-shadow-color), 0 10px 10px var(--dodo-shadow-color);
38
31
  box-shadow: var(--dodo-shadow);
39
32
  }
@@ -0,0 +1,7 @@
1
+ :root {
2
+ /* Space */
3
+ /* Example: calc(var(--dodo-ui-space) * 2), calc(var(--dodo-ui-space) / 2) */
4
+ --dodo-ui-space-small: 6px;
5
+ --dodo-ui-space: 8px;
6
+ --dodo-ui-space-large: 10px;
7
+ }
@@ -1,6 +1,7 @@
1
1
  @import '_minimal-reset.css';
2
2
  @import '_colors-base.css';
3
3
  @import '_colors.css';
4
+ @import '_space.css';
4
5
  @import '_breakpoint.css';
5
6
  @import '_shadow.css';
6
7
  @import '_components.css';
@@ -0,0 +1,7 @@
1
+ /** Component Color*/
2
+ export type ComponentColorPriority = 'primary' | 'secondary' | 'neutral';
3
+ export declare const componentColorPriorityArray: ComponentColorPriority[];
4
+ export type ComponentColorSeverity = 'safe' | 'warning' | 'danger';
5
+ export declare const componentColorSeverityArray: ComponentColorSeverity[];
6
+ export type ComponentColor = ComponentColorPriority | ComponentColorSeverity;
7
+ export declare const componentColorArray: ComponentColor[];
@@ -0,0 +1,10 @@
1
+ export const componentColorPriorityArray = [
2
+ 'primary',
3
+ 'secondary',
4
+ 'neutral',
5
+ ];
6
+ export const componentColorSeverityArray = ['safe', 'warning', 'danger'];
7
+ export const componentColorArray = [
8
+ ...componentColorPriorityArray,
9
+ ...componentColorSeverityArray,
10
+ ];
@@ -0,0 +1,3 @@
1
+ /** Component Roundness */
2
+ export type ComponentRoundness = 0 | 1 | 2 | 3 | 'full';
3
+ export declare const componentRoundnessArray: ComponentRoundness[];
@@ -0,0 +1 @@
1
+ export const componentRoundnessArray = [0, 1, 2, 3, 'full'];
@@ -0,0 +1,3 @@
1
+ /** Component Shadow */
2
+ export type ComponentShadow = 0 | 1 | 2 | 3 | 4 | 5;
3
+ export declare const componentShadowArray: ComponentShadow[];
@@ -0,0 +1 @@
1
+ export const componentShadowArray = [0, 1, 2, 3, 4, 5];
@@ -0,0 +1,3 @@
1
+ /** Component Size */
2
+ export type ComponentSize = 'normal' | 'small' | 'large';
3
+ export declare const componentSizeArray: ComponentSize[];
@@ -0,0 +1 @@
1
+ export const componentSizeArray = ['normal', 'small', 'large'];
@@ -0,0 +1,3 @@
1
+ /** Component Weight */
2
+ export type ComponentWeight = 'solid' | 'text';
3
+ export declare const componentWeightArray: ComponentWeight[];
@@ -0,0 +1 @@
1
+ export const componentWeightArray = ['solid', 'text'];
package/package.json CHANGED
@@ -1,6 +1,19 @@
1
1
  {
2
2
  "name": "@flightlesslabs/dodo-ui",
3
- "version": "0.6.5",
3
+ "version": "0.6.6",
4
+ "scripts": {
5
+ "build": "vite build && pnpm run prepack",
6
+ "preview": "vite preview",
7
+ "prepare": "svelte-kit sync || echo ''",
8
+ "prepack": "svelte-kit sync && svelte-package && publint",
9
+ "svelte-check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
10
+ "format": "prettier --write .",
11
+ "lint": "prettier --check . && eslint .",
12
+ "dev": "storybook dev -p 6006",
13
+ "build-storybook": "storybook build && touch ./storybook-static/.nojekyll",
14
+ "check": "pnpm run svelte-check && eslint . && pnpm run lint",
15
+ "check:fix": "pnpm run svelte-check && eslint . && pnpm run format"
16
+ },
4
17
  "homepage": "https://flightlesslabs.github.io/dodo-ui",
5
18
  "repository": {
6
19
  "type": "git",
@@ -37,9 +50,9 @@
37
50
  "devDependencies": {
38
51
  "@chromatic-com/storybook": "^3.2.6",
39
52
  "@eslint/compat": "^1.2.9",
40
- "@eslint/js": "^9.26.0",
53
+ "@eslint/js": "^9.27.0",
41
54
  "@storybook/addon-essentials": "^8.6.14",
42
- "@storybook/addon-svelte-csf": "5.0.0-next.28",
55
+ "@storybook/addon-svelte-csf": "5.0.1",
43
56
  "@storybook/blocks": "^8.6.14",
44
57
  "@storybook/experimental-addon-test": "^8.6.14",
45
58
  "@storybook/manager-api": "^8.6.14",
@@ -48,14 +61,14 @@
48
61
  "@storybook/test": "^8.6.14",
49
62
  "@storybook/theming": "^8.6.14",
50
63
  "@sveltejs/adapter-static": "^3.0.8",
51
- "@sveltejs/kit": "^2.21.0",
64
+ "@sveltejs/kit": "^2.21.1",
52
65
  "@sveltejs/package": "^2.3.11",
53
66
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
54
- "@vitest/browser": "^3.1.3",
55
- "@vitest/coverage-v8": "^3.1.3",
56
- "eslint": "^9.26.0",
67
+ "@vitest/browser": "^3.1.4",
68
+ "@vitest/coverage-v8": "^3.1.4",
69
+ "eslint": "^9.27.0",
57
70
  "eslint-config-prettier": "^10.1.5",
58
- "eslint-plugin-svelte": "^3.7.0",
71
+ "eslint-plugin-svelte": "^3.8.1",
59
72
  "globals": "^16.1.0",
60
73
  "playwright": "^1.52.0",
61
74
  "prettier": "^3.5.3",
@@ -64,33 +77,22 @@
64
77
  "sass": "^1.89.0",
65
78
  "storybook": "^8.6.14",
66
79
  "storybook-dark-mode": "^4.0.2",
67
- "svelte": "^5.30.1",
80
+ "svelte": "^5.31.1",
68
81
  "svelte-check": "^4.2.1",
69
82
  "svelte-preprocess": "^6.0.3",
70
83
  "typescript": "^5.8.3",
71
84
  "typescript-eslint": "^8.32.1",
72
85
  "vite": "^6.3.5",
73
- "vitest": "^3.1.3"
86
+ "vitest": "^3.1.4"
74
87
  },
75
88
  "keywords": [
76
89
  "svelte"
77
90
  ],
78
91
  "volta": {
79
- "node": "22.15.0",
80
- "pnpm": "10.10.0"
92
+ "node": "22.15.1",
93
+ "pnpm": "10.11.0"
81
94
  },
82
95
  "dependencies": {
83
96
  "@iconify/svelte": "^5.0.0"
84
- },
85
- "scripts": {
86
- "build": "vite build && pnpm run prepack",
87
- "preview": "vite preview",
88
- "svelte-check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
89
- "format": "prettier --write .",
90
- "lint": "prettier --check . && eslint .",
91
- "dev": "storybook dev -p 6006",
92
- "build-storybook": "storybook build && touch ./storybook-static/.nojekyll",
93
- "check": "pnpm run svelte-check && eslint . && pnpm run lint",
94
- "check:fix": "pnpm run svelte-check && eslint . && pnpm run format"
95
97
  }
96
- }
98
+ }
package/src/lib/index.ts CHANGED
@@ -1,6 +1,16 @@
1
1
  import '$lib/styles/global.css';
2
2
 
3
- export type { ComponentSize, ComponentRoundness, ComponentRoundnessFull } from './types.js';
3
+ export type {
4
+ ComponentColorPriority,
5
+ ComponentColorSeverity,
6
+ ComponentColor,
7
+ } from './types/colors.js';
8
+
9
+ export type { ComponentRoundness } from './types/roundness.js';
10
+
11
+ export type { ComponentSize } from './types/size.js';
12
+
13
+ export type { ComponentWeight } from './types/weight.js';
4
14
 
5
15
  /** developer tools: components: UtilityButton */
6
16
  export { default as UtilityButton } from '$lib/stories/developer tools/components/UtilityButton/UtilityButton.svelte';
@@ -11,10 +21,9 @@ export { default as InputEnclosure } from '$lib/stories/developer tools/componen
11
21
  /** Form: Button */
12
22
  export { default as Button } from '$lib/stories/components/Form/Button/Button.svelte';
13
23
  export type {
14
- ButtonColor,
15
- ButtonRoundness,
16
24
  ButtonLinkTarget,
17
25
  ButtonLinkReferrerpolicy,
26
+ ButtonType,
18
27
  } from '$lib/stories/components/Form/Button/Button.svelte';
19
28
 
20
29
  /** Form: TextInput */
@@ -37,7 +46,6 @@ export { default as FormControl } from '$lib/stories/components/Form/FormControl
37
46
 
38
47
  /** Form: Message */
39
48
  export { default as Message } from '$lib/stories/components/Form/Message/Message.svelte';
40
- export type { MessageColor } from '$lib/stories/components/Form/Message/Message.svelte';
41
49
 
42
50
  /** Form: SimpleSelect */
43
51
  export { default as SimpleSelect } from '$lib/stories/components/Form/SimpleSelect/SimpleSelect.svelte';
@@ -48,7 +56,4 @@ export type {
48
56
 
49
57
  /** Layout: Paper */
50
58
  export { default as Paper } from '$lib/stories/components/Layout/Paper/Paper.svelte';
51
- export type {
52
- PaperRoundness,
53
- PaperShadow,
54
- } from '$lib/stories/components/Layout/Paper/Paper.svelte';
59
+ export type { PaperColor } from '$lib/stories/components/Layout/Paper/Paper.svelte';
@@ -1,6 +1,4 @@
1
1
  <script lang="ts" module>
2
- export type ButtonColor = 'default' | 'primary' | 'secondary' | 'safe' | 'warning' | 'danger';
3
- export type ButtonRoundness = ComponentRoundness | false | ComponentRoundnessFull;
4
2
  export type ButtonLinkTarget =
5
3
  | '_self'
6
4
  | '_blank'
@@ -10,10 +8,16 @@
10
8
  | undefined
11
9
  | null;
12
10
  export type ButtonLinkReferrerpolicy = ReferrerPolicy | undefined | null;
11
+ export type ButtonType = 'button' | 'submit';
12
+ export const buttonTypeArray: ButtonType[] = ['button', 'submit'];
13
13
  </script>
14
14
 
15
15
  <script lang="ts">
16
- import type { ComponentRoundness, ComponentRoundnessFull, ComponentSize } from '$lib/types.js';
16
+ import type { ComponentColor } from '$lib/types/colors.js';
17
+ import type { ComponentRoundness } from '$lib/types/roundness.js';
18
+ import type { ComponentSize } from '$lib/types/size.js';
19
+ import type { ComponentWeight } from '$lib/types/weight.js';
20
+
17
21
  import type { Snippet } from 'svelte';
18
22
  import type { MouseEventHandler } from 'svelte/elements';
19
23
 
@@ -23,17 +27,17 @@
23
27
  /** Button ref */
24
28
  ref?: HTMLButtonElement | HTMLAnchorElement;
25
29
  /** Regular button or submit button? */
26
- type?: 'button' | 'submit';
30
+ type?: ButtonType;
27
31
  /** How large should the button be? */
28
32
  size?: ComponentSize;
29
33
  /** Full width button? */
30
34
  fullWidth?: boolean;
31
35
  /** What color to use? */
32
- color?: ButtonColor;
36
+ color?: ComponentColor;
33
37
  /** How round should the border radius be? */
34
- roundness?: ButtonRoundness;
38
+ roundness?: ComponentRoundness;
35
39
  /** How should the button appear? */
36
- variant?: 'text' | 'solid';
40
+ variant?: ComponentWeight;
37
41
  /** Add a border around the button */
38
42
  outline?: boolean;
39
43
  /** Compact button for icons */
@@ -73,17 +77,15 @@
73
77
  anchorMediaType?: string | undefined | null;
74
78
  /** Link button: referrerpolicy */
75
79
  referrerpolicy?: ButtonLinkReferrerpolicy;
76
- /** Test: ⚠️ Unsafe Children String. Do Not use*/
77
- _unsafeChildrenStringForTesting?: string;
78
80
  }
79
81
 
80
82
  let {
81
83
  children,
82
84
  type = 'button',
83
85
  size = 'normal',
84
- color = 'default',
85
- roundness = '1x',
86
- variant = 'text',
86
+ color = 'primary',
87
+ roundness = 1,
88
+ variant = 'solid',
87
89
  outline = false,
88
90
  compact = false,
89
91
  fullWidth = false,
@@ -104,7 +106,6 @@
104
106
  target,
105
107
  anchorMediaType,
106
108
  referrerpolicy,
107
- _unsafeChildrenStringForTesting,
108
109
  ref = $bindable<HTMLButtonElement | HTMLAnchorElement>(),
109
110
  }: ButtonProps = $props();
110
111
  </script>
@@ -118,8 +119,6 @@
118
119
 
119
120
  {#if children}
120
121
  {@render children()}
121
- {:else if _unsafeChildrenStringForTesting}
122
- {_unsafeChildrenStringForTesting}
123
122
  {/if}
124
123
 
125
124
  {#if after}
@@ -187,10 +186,10 @@
187
186
  @use 'utils/scss/mixins.scss' as *;
188
187
 
189
188
  :global(:root) {
190
- --dodo-ui-Button-disabled-color: var(--dodo-color-default-400);
191
- --dodo-ui-Button-disabled-bg: var(--dodo-color-default-200);
189
+ --dodo-ui-Button-disabled-color: var(--dodo-color-neutral-400);
190
+ --dodo-ui-Button-disabled-bg: var(--dodo-color-neutral-200);
192
191
 
193
- @include generate-dodo-ui-button-colors(default);
192
+ @include generate-dodo-ui-button-colors(neutral);
194
193
  @include generate-dodo-ui-button-colors(primary);
195
194
  @include generate-dodo-ui-button-colors(secondary);
196
195
  @include generate-dodo-ui-button-colors(safe);
@@ -199,10 +198,10 @@
199
198
  }
200
199
 
201
200
  :global(.dodo-theme--dark) {
202
- --dodo-ui-Button-disabled-bg: var(--dodo-color-default-100);
203
- --dodo-ui-Button-disabled-color: var(--dodo-color-default-500);
201
+ --dodo-ui-Button-disabled-bg: var(--dodo-color-neutral-100);
202
+ --dodo-ui-Button-disabled-color: var(--dodo-color-neutral-500);
204
203
 
205
- @include generate-dodo-ui-button-colors-dark(default);
204
+ @include generate-dodo-ui-button-colors-dark(neutral);
206
205
  @include generate-dodo-ui-button-colors-dark(primary);
207
206
  @include generate-dodo-ui-button-colors-dark(secondary);
208
207
  @include generate-dodo-ui-button-colors-dark(safe);
@@ -233,13 +232,13 @@
233
232
  &--normal {
234
233
  height: var(--dodo-ui-element-height-normal);
235
234
  font-size: 1rem;
236
- padding: 0 12px;
235
+ padding: 0 calc(var(--dodo-ui-space-small) * 2);
237
236
  min-width: 45px;
238
237
  }
239
238
 
240
239
  &--small {
241
240
  height: var(--dodo-ui-element-height-small);
242
- padding: 0 8px;
241
+ padding: 0 var(--dodo-ui-space);
243
242
  font-size: 0.9rem;
244
243
  min-width: 35px;
245
244
  }
@@ -247,22 +246,22 @@
247
246
  &--large {
248
247
  height: var(--dodo-ui-element-height-large);
249
248
  font-size: 1.1rem;
250
- padding: 0 16px;
249
+ padding: 0 calc(var(--dodo-ui-space) * 2);
251
250
  min-width: 85px;
252
251
  }
253
252
  }
254
253
 
255
254
  &.roundness {
256
- &--1x {
257
- border-radius: var(--dodo-ui-element-roundness-1x);
255
+ &--1 {
256
+ border-radius: var(--dodo-ui-element-roundness-1);
258
257
  }
259
258
 
260
- &--2x {
261
- border-radius: var(--dodo-ui-element-roundness-2x);
259
+ &--2 {
260
+ border-radius: var(--dodo-ui-element-roundness-2);
262
261
  }
263
262
 
264
- &--3x {
265
- border-radius: var(--dodo-ui-element-roundness-3x);
263
+ &--3 {
264
+ border-radius: var(--dodo-ui-element-roundness-3);
266
265
  }
267
266
 
268
267
  &--full {
@@ -271,7 +270,7 @@
271
270
  }
272
271
 
273
272
  &.color {
274
- @include generate-dodo-ui-button-color(default);
273
+ @include generate-dodo-ui-button-color(neutral);
275
274
  @include generate-dodo-ui-button-color(primary);
276
275
  @include generate-dodo-ui-button-color(secondary);
277
276
  @include generate-dodo-ui-button-color(safe);
@@ -50,18 +50,13 @@
50
50
  </div>
51
51
 
52
52
  <style lang="scss">
53
- :global(:root) {
54
- --dodo-ui-FormControl-LabelSection-gap: 8px;
55
- --dodo-ui-FormControl-errorMessage-gap: 10px;
56
- }
57
-
58
53
  .dodo-ui-FormControl {
59
54
  .LabelSection {
60
- margin-bottom: var(--dodo-ui-FormControl-LabelSection-gap);
55
+ margin-bottom: var(--dodo-ui-space);
61
56
  }
62
57
 
63
58
  .errorMessage {
64
- margin-top: var(--dodo-ui-FormControl-errorMessage-gap);
59
+ margin-top: var(--dodo-ui-space-large);
65
60
  }
66
61
  }
67
62
  </style>
@@ -12,8 +12,6 @@
12
12
  form?: string;
13
13
  /** Custom css class*/
14
14
  class?: string;
15
- /** Test: ⚠️ Unsafe Children String. Do Not use*/
16
- _unsafeChildrenStringForTesting?: string;
17
15
  }
18
16
 
19
17
  let {
@@ -21,7 +19,6 @@
21
19
  class: className = '',
22
20
  for: htmlFor,
23
21
  form,
24
- _unsafeChildrenStringForTesting,
25
22
  ref = $bindable<HTMLLabelElement>(),
26
23
  }: LabelProps = $props();
27
24
  </script>
@@ -29,15 +26,13 @@
29
26
  <label class={['dodo-ui-Label', className].join(' ')} for={htmlFor} {form} bind:this={ref}>
30
27
  {#if children}
31
28
  {@render children()}
32
- {:else if _unsafeChildrenStringForTesting}
33
- {_unsafeChildrenStringForTesting}
34
29
  {/if}
35
30
  </label>
36
31
 
37
32
  <style lang="scss">
38
33
  .dodo-ui-Label {
39
34
  font-size: 0.95rem;
40
- color: var(--dodo-color-default-700);
35
+ color: var(--dodo-color-neutral-700);
41
36
  display: flex;
42
37
  align-items: center;
43
38
  font-family: inherit;
@@ -1,9 +1,7 @@
1
- <script lang="ts" module>
2
- export type MessageColor = 'default' | 'primary' | 'secondary' | 'safe' | 'warning' | 'danger';
3
- </script>
4
-
5
1
  <script lang="ts">
6
- import type { ComponentSize } from '$lib/types.js';
2
+ import type { ComponentColor } from '$lib/types/colors.js';
3
+
4
+ import type { ComponentSize } from '$lib/types/size.js';
7
5
 
8
6
  import type { Snippet } from 'svelte';
9
7
 
@@ -13,21 +11,18 @@
13
11
  /** Message ref */
14
12
  ref?: HTMLDivElement;
15
13
  /** What color to use? */
16
- color?: MessageColor;
14
+ color?: ComponentColor;
17
15
  /** Message size */
18
16
  size?: ComponentSize;
19
17
  /** Custom css class*/
20
18
  class?: string;
21
- /** Test: ⚠️ Unsafe Children String. Do Not use*/
22
- _unsafeChildrenStringForTesting?: string;
23
19
  }
24
20
 
25
21
  let {
26
22
  children,
27
23
  class: className = '',
28
- color = 'default',
24
+ color = 'primary',
29
25
  ref = $bindable<HTMLDivElement>(),
30
- _unsafeChildrenStringForTesting,
31
26
  size = 'normal',
32
27
  }: MessageProps = $props();
33
28
  </script>
@@ -38,8 +33,6 @@
38
33
  >
39
34
  {#if children}
40
35
  {@render children()}
41
- {:else if _unsafeChildrenStringForTesting}
42
- {_unsafeChildrenStringForTesting}
43
36
  {/if}
44
37
  </div>
45
38
 
@@ -64,10 +57,6 @@
64
57
  }
65
58
 
66
59
  &.color {
67
- &--default {
68
- color: var(--dodo-color-default-800);
69
- }
70
-
71
60
  &--primary {
72
61
  color: var(--dodo-color-primary-600);
73
62
  }
@@ -76,6 +65,10 @@
76
65
  color: var(--dodo-color-secondary-600);
77
66
  }
78
67
 
68
+ &--neutral {
69
+ color: var(--dodo-color-neutral-600);
70
+ }
71
+
79
72
  &--safe {
80
73
  color: var(--dodo-color-safe-600);
81
74
  }
@@ -6,7 +6,6 @@
6
6
  </script>
7
7
 
8
8
  <script lang="ts">
9
- import type { ComponentRoundness, ComponentSize } from '$lib/types.js';
10
9
  import type { Snippet } from 'svelte';
11
10
  import type {
12
11
  ChangeEventHandler,
@@ -18,6 +17,8 @@
18
17
  import Icon from '@iconify/svelte';
19
18
  import UtilityButton from '$lib/stories/developer tools/components/UtilityButton/UtilityButton.svelte';
20
19
  import InputEnclosure from '$lib/stories/developer tools/components/InputEnclosure/InputEnclosure.svelte';
20
+ import type { ComponentSize } from '$lib/types/size.js';
21
+ import type { ComponentRoundness } from '$lib/types/roundness.js';
21
22
 
22
23
  interface PasswordInputProps {
23
24
  /** How large should the button be? */
@@ -31,7 +32,7 @@
31
32
  /** Toggle Password Icon */
32
33
  customPasswordToggleIcon?: (toggle: boolean) => Snippet;
33
34
  /** How round should the border radius be? */
34
- roundness?: ComponentRoundness | false;
35
+ roundness?: ComponentRoundness;
35
36
  /** Add a border around the button. Default True */
36
37
  outline?: boolean;
37
38
  /** Input value */
@@ -74,7 +75,7 @@
74
75
 
75
76
  let {
76
77
  size = 'normal',
77
- roundness = '1x',
78
+ roundness = 1,
78
79
  outline = true,
79
80
  name,
80
81
  id,
@@ -194,13 +195,13 @@
194
195
  &--normal {
195
196
  input {
196
197
  font-size: 1rem;
197
- padding: 0 12px;
198
+ padding: 0 calc(var(--dodo-ui-space-small) * 2);
198
199
  }
199
200
  }
200
201
 
201
202
  &--small {
202
203
  input {
203
- padding: 0 8px;
204
+ padding: 0 var(--dodo-ui-space);
204
205
  font-size: 0.9rem;
205
206
  }
206
207
  }
@@ -208,7 +209,7 @@
208
209
  &--large {
209
210
  input {
210
211
  font-size: 1.1rem;
211
- padding: 0 14px;
212
+ padding: 0 calc(var(--dodo-ui-space) * 2);
212
213
  }
213
214
  }
214
215
  }
@@ -12,8 +12,9 @@
12
12
 
13
13
  <script lang="ts">
14
14
  import InputEnclosure from '$lib/stories/developer tools/components/InputEnclosure/InputEnclosure.svelte';
15
+ import type { ComponentRoundness } from '$lib/types/roundness.js';
16
+ import type { ComponentSize } from '$lib/types/size.js';
15
17
 
16
- import type { ComponentRoundness, ComponentSize } from '$lib/types.js';
17
18
  import type { Snippet } from 'svelte';
18
19
  import type { ChangeEventHandler, FocusEventHandler } from 'svelte/elements';
19
20
 
@@ -23,7 +24,7 @@
23
24
  /** How large should the button be? */
24
25
  size?: ComponentSize;
25
26
  /** How round should the border radius be? */
26
- roundness?: ComponentRoundness | false;
27
+ roundness?: ComponentRoundness;
27
28
  /** How round should the border radius be? */
28
29
  options: SimpleSelectOption[];
29
30
  /** Add a border around the button. Default True */
@@ -56,7 +57,7 @@
56
57
 
57
58
  let {
58
59
  size = 'normal',
59
- roundness = '1x',
60
+ roundness = 1,
60
61
  outline = true,
61
62
  name,
62
63
  id,
@@ -137,13 +138,13 @@
137
138
  &--normal {
138
139
  select {
139
140
  font-size: 1rem;
140
- padding: 0 12px;
141
+ padding: 0 calc(var(--dodo-ui-space-small) * 2);
141
142
  }
142
143
  }
143
144
 
144
145
  &--small {
145
146
  select {
146
- padding: 0 8px;
147
+ padding: 0 var(--dodo-ui-space);
147
148
  font-size: 0.9rem;
148
149
  }
149
150
  }
@@ -151,7 +152,7 @@
151
152
  &--large {
152
153
  select {
153
154
  font-size: 1.1rem;
154
- padding: 0 14px;
155
+ padding: 0 calc(var(--dodo-ui-space) * 2);
155
156
  }
156
157
  }
157
158
  }