@alto-avios/alto-ui 2.3.3 → 3.0.0

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 (191) hide show
  1. package/README.md +33 -9
  2. package/dist/assets/AviosCurrencySymbol.css +1 -0
  3. package/dist/assets/Badge.css +1 -1
  4. package/dist/assets/Button.css +1 -1
  5. package/dist/assets/ButtonGroup.css +1 -1
  6. package/dist/assets/CardSection.css +1 -1
  7. package/dist/assets/Checkbox.css +1 -1
  8. package/dist/assets/CheckboxGroup.css +1 -1
  9. package/dist/assets/ClearFieldButton.css +1 -1
  10. package/dist/assets/DateField.css +1 -1
  11. package/dist/assets/Eyebrow.css +1 -1
  12. package/dist/assets/FieldDescription.css +1 -1
  13. package/dist/assets/FieldError.css +1 -1
  14. package/dist/assets/FieldHeader.css +1 -1
  15. package/dist/assets/FieldLabel.css +1 -1
  16. package/dist/assets/Fieldset.css +1 -0
  17. package/dist/assets/FieldsetHeader.css +1 -0
  18. package/dist/assets/Form.css +1 -0
  19. package/dist/assets/Grid.css +1 -1
  20. package/dist/assets/Heading.css +1 -1
  21. package/dist/assets/IconButton.css +1 -1
  22. package/dist/assets/Image.css +1 -0
  23. package/dist/assets/Link.css +1 -1
  24. package/dist/assets/LoadingSpinner.css +1 -1
  25. package/dist/assets/NumberField.css +1 -0
  26. package/dist/assets/Radio.css +1 -1
  27. package/dist/assets/RadioGroup.css +1 -1
  28. package/dist/assets/Section.css +1 -0
  29. package/dist/assets/SubHeading.css +1 -1
  30. package/dist/assets/Tag.css +1 -1
  31. package/dist/assets/TextAreaField.css +1 -1
  32. package/dist/assets/ToggleButton.css +1 -1
  33. package/dist/assets/ToggleIconButton.css +1 -1
  34. package/dist/assets/Tooltip.css +1 -1
  35. package/dist/assets/fgColor.css +1 -1
  36. package/dist/assets/focusStyles.css +1 -1
  37. package/dist/assets/global.css +1 -1
  38. package/dist/assets/padding.css +1 -1
  39. package/dist/components/AviosCurrencySymbol/AviosCurrencySymbol.d.ts +25 -0
  40. package/dist/components/AviosCurrencySymbol/AviosCurrencySymbol.js +80 -0
  41. package/dist/components/AviosCurrencySymbol/AviosCurrencySymbol.js.map +1 -0
  42. package/dist/components/AviosCurrencySymbol/index.d.ts +1 -0
  43. package/dist/components/AviosCurrencySymbol/index.js +5 -0
  44. package/dist/components/Badge/Badge.js +11 -11
  45. package/dist/components/Box/Box.d.ts +18 -3
  46. package/dist/components/Box/Box.js +9 -3
  47. package/dist/components/Box/Box.js.map +1 -1
  48. package/dist/components/Button/Button.d.ts +128 -36
  49. package/dist/components/Button/Button.js +129 -66
  50. package/dist/components/Button/Button.js.map +1 -1
  51. package/dist/components/ButtonGroup/ButtonGroup.js +8 -8
  52. package/dist/components/CardSection/CardSection.d.ts +12 -6
  53. package/dist/components/CardSection/CardSection.js +9 -7
  54. package/dist/components/CardSection/CardSection.js.map +1 -1
  55. package/dist/components/Checkbox/Checkbox.d.ts +4 -2
  56. package/dist/components/Checkbox/Checkbox.js +12 -10
  57. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  58. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +12 -12
  59. package/dist/components/CheckboxGroup/CheckboxGroup.js +3 -3
  60. package/dist/components/ClearFieldButton/ClearFieldButton.d.ts +4 -6
  61. package/dist/components/ClearFieldButton/ClearFieldButton.js +4 -4
  62. package/dist/components/DateField/DateField.d.ts +4 -24
  63. package/dist/components/DateField/DateField.js +7 -19
  64. package/dist/components/DateField/DateField.js.map +1 -1
  65. package/dist/components/DestinationHeading/DestinationHeading.d.ts +1 -1
  66. package/dist/components/Eyebrow/Eyebrow.js +5 -5
  67. package/dist/components/FieldDescription/FieldDescription.js +1 -1
  68. package/dist/components/FieldError/FieldError.d.ts +1 -1
  69. package/dist/components/FieldError/FieldError.js +12 -9
  70. package/dist/components/FieldError/FieldError.js.map +1 -1
  71. package/dist/components/FieldHeader/FieldHeader.d.ts +2 -1
  72. package/dist/components/FieldHeader/FieldHeader.js +5 -4
  73. package/dist/components/FieldHeader/FieldHeader.js.map +1 -1
  74. package/dist/components/FieldHeader/index.d.ts +1 -0
  75. package/dist/components/FieldLabel/FieldLabel.d.ts +1 -1
  76. package/dist/components/FieldLabel/FieldLabel.js +1 -2
  77. package/dist/components/FieldLabel/FieldLabel.js.map +1 -1
  78. package/dist/components/Fieldset/Fieldset.d.ts +18 -0
  79. package/dist/components/Fieldset/Fieldset.js +24 -0
  80. package/dist/components/Fieldset/Fieldset.js.map +1 -0
  81. package/dist/components/Fieldset/index.d.ts +2 -0
  82. package/dist/components/Fieldset/index.js +5 -0
  83. package/dist/components/Fieldset/index.js.map +1 -0
  84. package/dist/components/FieldsetHeader/FieldsetHeader.d.ts +7 -0
  85. package/dist/components/FieldsetHeader/FieldsetHeader.js +21 -0
  86. package/dist/components/FieldsetHeader/FieldsetHeader.js.map +1 -0
  87. package/dist/components/FieldsetHeader/index.d.ts +1 -0
  88. package/dist/components/FieldsetHeader/index.js +5 -0
  89. package/dist/components/FieldsetHeader/index.js.map +1 -0
  90. package/dist/components/Form/Form.d.ts +7 -0
  91. package/dist/components/Form/Form.js +17 -0
  92. package/dist/components/Form/Form.js.map +1 -0
  93. package/dist/components/Form/index.d.ts +1 -0
  94. package/dist/components/Form/index.js +5 -0
  95. package/dist/components/Form/index.js.map +1 -0
  96. package/dist/components/Grid/Grid.d.ts +35 -16
  97. package/dist/components/Grid/Grid.js +63 -30
  98. package/dist/components/Grid/Grid.js.map +1 -1
  99. package/dist/components/Heading/Heading.d.ts +2 -2
  100. package/dist/components/Heading/Heading.js +19 -17
  101. package/dist/components/Heading/Heading.js.map +1 -1
  102. package/dist/components/Icon/Icon.d.ts +4 -4
  103. package/dist/components/Icon/Icon.js +1 -0
  104. package/dist/components/Icon/Icon.js.map +1 -1
  105. package/dist/components/IconButton/IconButton.d.ts +13 -4
  106. package/dist/components/IconButton/IconButton.js +35 -26
  107. package/dist/components/IconButton/IconButton.js.map +1 -1
  108. package/dist/components/Image/Image.d.ts +23 -0
  109. package/dist/components/Image/Image.js +130 -0
  110. package/dist/components/Image/Image.js.map +1 -0
  111. package/dist/components/Image/index.d.ts +1 -0
  112. package/dist/components/Image/index.js +5 -0
  113. package/dist/components/Image/index.js.map +1 -0
  114. package/dist/components/Link/Link.d.ts +32 -34
  115. package/dist/components/Link/Link.js +34 -22
  116. package/dist/components/Link/Link.js.map +1 -1
  117. package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -2
  118. package/dist/components/LoadingSpinner/LoadingSpinner.js +5 -5
  119. package/dist/components/NumberField/NumberField.d.ts +25 -0
  120. package/dist/components/NumberField/NumberField.js +35 -0
  121. package/dist/components/NumberField/NumberField.js.map +1 -0
  122. package/dist/components/NumberField/index.d.ts +1 -0
  123. package/dist/components/NumberField/index.js +5 -0
  124. package/dist/components/NumberField/index.js.map +1 -0
  125. package/dist/components/Paragraph/Paragraph.d.ts +4 -4
  126. package/dist/components/Radio/Radio.js +3 -3
  127. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  128. package/dist/components/RadioGroup/RadioGroup.js +1 -2
  129. package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
  130. package/dist/components/Section/Section.d.ts +29 -0
  131. package/dist/components/Section/Section.js +103 -0
  132. package/dist/components/Section/Section.js.map +1 -0
  133. package/dist/components/Section/index.d.ts +1 -0
  134. package/dist/components/Section/index.js +5 -0
  135. package/dist/components/Section/index.js.map +1 -0
  136. package/dist/components/SubHeading/SubHeading.d.ts +1 -1
  137. package/dist/components/SubHeading/SubHeading.js +8 -8
  138. package/dist/components/Tag/Tag.d.ts +2 -2
  139. package/dist/components/Tag/Tag.js +4 -4
  140. package/dist/components/TagGroup/TagGroup.d.ts +2 -2
  141. package/dist/components/TagGroup/TagGroup.js +1 -1
  142. package/dist/components/TextAreaField/TextAreaField.d.ts +1 -1
  143. package/dist/components/TextAreaField/TextAreaField.js +6 -18
  144. package/dist/components/TextAreaField/TextAreaField.js.map +1 -1
  145. package/dist/components/TextField/TextField.d.ts +4 -31
  146. package/dist/components/TextField/TextField.js +7 -17
  147. package/dist/components/TextField/TextField.js.map +1 -1
  148. package/dist/components/ToggleButton/ToggleButton.js +6 -6
  149. package/dist/components/ToggleIconButton/ToggleIconButton.d.ts +9 -1
  150. package/dist/components/ToggleIconButton/ToggleIconButton.js +15 -8
  151. package/dist/components/ToggleIconButton/ToggleIconButton.js.map +1 -1
  152. package/dist/components/Tooltip/Tooltip.js +3 -3
  153. package/dist/components/_base/Field/Field.d.ts +16 -0
  154. package/dist/components/_base/Field/Field.js +32 -0
  155. package/dist/components/_base/Field/Field.js.map +1 -0
  156. package/dist/components/_base/Field/index.d.ts +2 -0
  157. package/dist/components/_base/Field/index.js +5 -0
  158. package/dist/components/_base/Field/index.js.map +1 -0
  159. package/dist/components/index.d.ts +7 -1
  160. package/dist/components/index.js +22 -10
  161. package/dist/components/index.js.map +1 -1
  162. package/dist/index.js +22 -10
  163. package/dist/index.js.map +1 -1
  164. package/dist/utils/backgroundColour/backgroundColour.d.ts +1 -1
  165. package/dist/utils/border/border.d.ts +3 -3
  166. package/dist/utils/fgColour/fgColor.d.ts +1 -1
  167. package/dist/utils/fgColour/fgColor.js +34 -34
  168. package/dist/utils/flex/flex.d.ts +2 -2
  169. package/dist/utils/flex/flex.js +3 -1
  170. package/dist/utils/flex/flex.js.map +1 -1
  171. package/dist/utils/focus/focusStyles.d.ts +1 -1
  172. package/dist/utils/focus/focusStyles.js +2 -2
  173. package/dist/utils/forms/formProps.d.ts +2 -0
  174. package/dist/utils/forms/formProps.js +2 -0
  175. package/dist/utils/forms/formProps.js.map +1 -0
  176. package/dist/utils/padding/padding.d.ts +7 -7
  177. package/dist/utils/padding/padding.js +271 -46
  178. package/dist/utils/padding/padding.js.map +1 -1
  179. package/dist/utils/spaceToken/spaceToken.d.ts +3 -0
  180. package/dist/utils/spaceToken/spaceToken.js +25 -0
  181. package/dist/utils/spaceToken/spaceToken.js.map +1 -0
  182. package/dist/utils/stories/iconPropsArgTypes.js +14 -13
  183. package/dist/utils/stories/iconPropsArgTypes.js.map +1 -1
  184. package/package.json +75 -19
  185. package/dist/assets/NewButton.css +0 -1
  186. package/dist/components/NewButton/NewButton.d.ts +0 -87
  187. package/dist/components/NewButton/NewButton.js +0 -189
  188. package/dist/components/NewButton/NewButton.js.map +0 -1
  189. package/dist/components/NewButton/index.d.ts +0 -1
  190. package/dist/components/NewButton/index.js +0 -5
  191. /package/dist/components/{NewButton → AviosCurrencySymbol}/index.js.map +0 -0
package/package.json CHANGED
@@ -1,36 +1,66 @@
1
1
  {
2
2
  "name": "@alto-avios/alto-ui",
3
- "version": "2.3.3",
3
+ "version": "3.0.0",
4
4
  "description": "A react component library for Alto Design System",
5
- "author": "Ian Caldwell IAGL",
5
+ "author": {
6
+ "name": "Ian Caldwell IAGL",
7
+ "email": "ian.1.caldwell@avios.com"
8
+ },
9
+ "contributors": [
10
+ {
11
+ "name": "Gup Badyal IAGL ",
12
+ "email": "gurpreet.badyal@avios.com"
13
+ },
14
+ {
15
+ "name": "Antonio Santos IAGL",
16
+ "email": "antonio.santos@avios.com"
17
+ }
18
+ ],
6
19
  "license": "MIT",
7
20
  "type": "module",
8
21
  "scripts": {
9
22
  "test": "jest",
23
+ "test-a11y": "test-storybook",
10
24
  "clean-dist": "rimraf dist",
11
25
  "vite": "npm run clean-dist && tsc --p ./tsconfig.build.json && vite build",
12
26
  "storybook": "storybook dev -p 6006",
13
- "build:storybook": "storybook build"
27
+ "build:storybook": "storybook build",
28
+ "lint": "eslint",
29
+ "lint:fix": "eslint --fix && npx prettier . --write --ignore-unknown",
30
+ "commit": "cz",
31
+ "pre-commit": "lint-staged",
32
+ "prepare": "husky",
33
+ "generate": "plop",
34
+ "release": "standard-version",
35
+ "release:minor": "standard-version --release-as minor",
36
+ "release:patch": "standard-version --release-as patch",
37
+ "release:major": "standard-version --release-as major"
14
38
  },
15
39
  "dependencies": {
16
40
  "class-variance-authority": "^0.7.0",
17
- "react-aria-components": "^1.4.0",
41
+ "react-aria-components": "^1.5.0",
18
42
  "ts-node": "^10.9.2"
19
43
  },
20
44
  "devDependencies": {
21
45
  "@chromatic-com/storybook": "^1.4.0",
46
+ "@commitlint/cli": "^19.6.0",
47
+ "@commitlint/config-conventional": "^19.6.0",
48
+ "@commitlint/cz-commitlint": "^19.5.0",
49
+ "@eslint/js": "^9.14.0",
22
50
  "@omlet/cli": "^1.6.1",
23
- "@storybook/addon-a11y": "^8.1.9",
24
- "@storybook/addon-essentials": "^8.1.9",
25
- "@storybook/addon-interactions": "^8.1.9",
26
- "@storybook/addon-links": "^8.1.9",
27
- "@storybook/addon-onboarding": "^8.1.9",
28
- "@storybook/addon-themes": "^8.1.9",
51
+ "@storybook/addon-a11y": "^8.4.4",
52
+ "@storybook/addon-actions": "^8.4.4",
53
+ "@storybook/addon-essentials": "^8.4.4",
54
+ "@storybook/addon-interactions": "^8.4.4",
55
+ "@storybook/addon-links": "^8.4.4",
56
+ "@storybook/addon-onboarding": "^8.4.4",
57
+ "@storybook/addon-themes": "^8.4.4",
29
58
  "@storybook/addon-webpack5-compiler-swc": "^1.0.2",
30
- "@storybook/blocks": "^8.2.9",
31
- "@storybook/react": "^8.1.9",
32
- "@storybook/react-webpack5": "^8.1.9",
33
- "@storybook/test": "^8.1.9",
59
+ "@storybook/blocks": "^8.4.4",
60
+ "@storybook/react": "^8.4.4",
61
+ "@storybook/react-webpack5": "^8.4.4",
62
+ "@storybook/test": "^8.4.4",
63
+ "@storybook/test-runner": "^0.19.1",
34
64
  "@testing-library/dom": "^10.4.0",
35
65
  "@testing-library/jest-dom": "^6.4.8",
36
66
  "@testing-library/react": "^16.0.0",
@@ -40,29 +70,43 @@
40
70
  "@types/react-dom": "^18.3.0",
41
71
  "@vitejs/plugin-react": "^4.3.1",
42
72
  "autoprefixer": "^10.4.19",
73
+ "axe-playwright": "^2.0.3",
74
+ "commitizen": "^4.3.1",
43
75
  "cssnano": "^7.0.4",
76
+ "eslint": "^9.14.0",
77
+ "eslint-config-prettier": "^9.1.0",
78
+ "eslint-plugin-react": "^7.37.2",
44
79
  "glob": "^11.0.0",
80
+ "globals": "^15.12.0",
81
+ "husky": "^9.1.6",
45
82
  "identity-obj-proxy": "^3.0.0",
46
83
  "jest": "^29.7.0",
47
84
  "jest-axe": "^9.0.0",
48
85
  "jest-environment-jsdom": "^29.7.0",
86
+ "jest-sonar": "^0.2.16",
87
+ "lint-staged": "^15.2.10",
88
+ "plop": "^4.0.1",
49
89
  "postcss": "^8.4.40",
90
+ "prettier": "3.3.3",
50
91
  "react": "^18.3.1",
51
92
  "react-dom": "^18.3.1",
52
93
  "react-remove-attr": "^0.0.6",
53
94
  "rimraf": "^6.0.1",
54
- "storybook": "^8.1.9",
95
+ "standard-version": "^9.5.0",
96
+ "storybook": "^8.4.4",
55
97
  "terser": "^5.31.3",
56
- "ts-jest": "^29.2.4",
98
+ "ts-jest": "^29.2.5",
57
99
  "tslib": "^2.6.2",
58
100
  "typescript": "^5.4.5",
101
+ "typescript-eslint": "^8.14.0",
59
102
  "vite": "^5.3.5",
60
103
  "vite-bundle-visualizer": "^1.2.1",
61
104
  "vite-plugin-dts": "^4.0.0-beta.2",
62
- "vite-plugin-lib-inject-css": "^2.1.1"
105
+ "vite-plugin-lib-inject-css": "^2.1.1",
106
+ "wait-on": "^8.0.1"
63
107
  },
64
108
  "peerDependencies": {
65
- "@alto-avios/alto-tokens": "^2.3.0",
109
+ "@alto-avios/alto-tokens": "^3.0.1",
66
110
  "react": "^18.0.0"
67
111
  },
68
112
  "main": "dist/index.js",
@@ -77,5 +121,17 @@
77
121
  "sideEffects": [
78
122
  "*.css"
79
123
  ],
80
- "types": "dist/index.d.ts"
124
+ "types": "dist/index.d.ts",
125
+ "lint-staged": {
126
+ "src/**/*": "prettier --write --ignore-unknown",
127
+ "src/**/*.{js,jsx,ts,tsx}": [
128
+ "eslint --fix",
129
+ "jest --bail --findRelatedTests --verbose --passWithNoTests"
130
+ ]
131
+ },
132
+ "config": {
133
+ "commitizen": {
134
+ "path": "@commitlint/cz-commitlint"
135
+ }
136
+ }
81
137
  }
@@ -1 +0,0 @@
1
- ._newButton_1ajlh_1{align-items:center;background:var(--alto-sem-color-bg-accent-vibrant-default);border:none;border-radius:var(--alto-button-md-radius);box-sizing:border-box;color:var(--alto-sem-color-fg-accent-on-vibrant);cursor:pointer;font-family:var(--alto-sem-text-body-font-family);font-size:var(--alto-sem-text-body-md-font-size);font-style:normal;font-weight:var(--alto-sem-text-body-regular-font-weight);justify-content:center;letter-spacing:var(--alto-sem-text-body-md-letter-spacing);line-height:var(--alto-sem-text-body-md-line-height);max-height:48px;padding:var(--alto-sem-space-xs) var(--alto-sem-space-md);text-decoration:none}._newButton_1ajlh_1,._newButton_1ajlh_1 ._content_1ajlh_23{display:inline-flex;gap:var(--alto-sem-space-2xs)}._isNotLoading_1ajlh_31 ._loadingSpinner_1ajlh_31{opacity:0;position:absolute}._isNotLoading_1ajlh_31 ._content_1ajlh_23{opacity:1}._isLoading_1ajlh_40 ._loadingSpinner_1ajlh_31{opacity:1;position:absolute}._isLoading_1ajlh_40 ._content_1ajlh_23{opacity:0}._focusWhite_1ajlh_52:focus-visible{outline-color:var(--alto-sem-color-border-white)}._sm_1ajlh_59{max-height:34px;padding:var(--alto-sem-space-2xs) var(--alto-sem-space-sm)}._md_1ajlh_64{max-height:48px;padding:var(--alto-sem-space-xs) var(--alto-sem-space-md)}._lg_1ajlh_69{max-height:55px;padding:var(--alto-sem-space-sm) var(--alto-sem-space-lg)}._fullWidth_1ajlh_74{width:100%}._accentPrimary_1ajlh_82[data-focused],._accentPrimary_1ajlh_82[data-hovered]{background:var(--alto-sem-color-bg-accent-vibrant-hover)}._accentPrimary_1ajlh_82[data-pressed]{background:var(--alto-sem-color-bg-accent-vibrant-active)}._accentPrimary_1ajlh_82[data-pressed][data-focused]{outline:none}._accentPrimary_1ajlh_82:disabled{background:var(--alto-sem-color-bg-disabled-vibrant);cursor:default;pointer-events:none}._accentSecondary_1ajlh_101{background:var(--alto-sem-color-bg-layer2-default);border:var(--alto-sem-border-width-sm) solid var(--alto-sem-color-border-accent);color:var(--alto-sem-color-fg-accent-primary)}._accentSecondary_1ajlh_101[data-focused],._accentSecondary_1ajlh_101[data-hovered]{background:var(--alto-sem-color-bg-accent-subtle-hover)}._accentSecondary_1ajlh_101[data-pressed]{background:var(--alto-sem-color-bg-accent-subtle-active)}._accentSecondary_1ajlh_101[data-pressed][data-focused]{outline:none}._accentSecondary_1ajlh_101:disabled{background:none;border:var(--alto-sem-border-width-sm) solid var(--alto-sem-color-border-disabled-vibrant);color:var(--alto-sem-color-fg-disabled-primary);cursor:not-allowed;pointer-events:none}._accentTertiary_1ajlh_128{background:var(--alto-sem-color-bg-accent-subtle-default);color:var(--alto-sem-color-fg-accent-primary)}._accentTertiary_1ajlh_128[data-focused],._accentTertiary_1ajlh_128[data-hovered]{background:var(--alto-sem-color-bg-accent-subtle-hover)}._accentTertiary_1ajlh_128[data-pressed]{background:var(--alto-sem-color-bg-accent-subtle-active)}._accentTertiary_1ajlh_128[data-pressed][data-focused]{outline:none}._accentTertiary_1ajlh_128:disabled{background:var(--alto-sem-color-bg-disabled-subtle);color:var(--alto-sem-color-fg-disabled-primary);cursor:not-allowed;pointer-events:none}._accentQuaternary_1ajlh_153{background:none;color:var(--alto-sem-color-fg-accent-primary)}._accentQuaternary_1ajlh_153[data-hovered][data-focused]{background:var(--alto-sem-color-bg-accent-subtle-hover)}._accentQuaternary_1ajlh_153[data-pressed]{background:var(--alto-sem-color-bg-accent-subtle-active)}._accentQuaternary_1ajlh_153[data-pressed][data-focused]{outline:none}._accentQuaternary_1ajlh_153:disabled{color:var(--alto-sem-color-fg-disabled-primary);cursor:not-allowed;pointer-events:none}._criticalPrimary_1ajlh_177{background:var(--alto-sem-color-bg-critical-vibrant-default);color:var(--alto-sem-color-fg-critical-on-vibrant)}._criticalPrimary_1ajlh_177[data-focused],._criticalPrimary_1ajlh_177[data-hovered]{background:var(--alto-sem-color-bg-critical-vibrant-hover)}._criticalPrimary_1ajlh_177[data-pressed]{background:var(--alto-sem-color-bg-critical-vibrant-active)}._criticalPrimary_1ajlh_177[data-pressed][data-focused]{outline:none}._criticalPrimary_1ajlh_177:disabled{background:var(--alto-sem-color-bg-disabled-vibrant);cursor:not-allowed;pointer-events:none}._criticalSecondary_1ajlh_201{background:var(--alto-sem-color-bg-layer2-default);border:var(--alto-sem-border-width-sm) solid var(--alto-sem-color-border-critical);color:var(--alto-sem-color-fg-critical-primary)}._criticalSecondary_1ajlh_201[data-focused],._criticalSecondary_1ajlh_201[data-hovered]{background:var(--alto-sem-color-bg-critical-subtle-hover)}._criticalSecondary_1ajlh_201[data-pressed]{background:var(--alto-sem-color-bg-critical-subtle-active)}._criticalSecondary_1ajlh_201[data-pressed][data-focused]{outline:none}._criticalSecondary_1ajlh_201:disabled{background:none;border:var(--alto-sem-border-width-sm) solid var(--alto-sem-color-border-disabled-vibrant);color:var(--alto-sem-color-fg-disabled-primary);cursor:not-allowed;pointer-events:none}._criticalTertiary_1ajlh_228{background:var(--alto-sem-color-bg-critical-subtle-default);color:var(--alto-sem-color-fg-critical-primary)}._criticalTertiary_1ajlh_228[data-focused],._criticalTertiary_1ajlh_228[data-hovered]{background:var(--alto-sem-color-bg-critical-subtle-hover)}._criticalTertiary_1ajlh_228[data-pressed]{background:var(--alto-sem-color-bg-critical-subtle-active)}._criticalTertiary_1ajlh_228[data-pressed][data-focused]{outline:none}._criticalTertiary_1ajlh_228:disabled{background:var(--alto-sem-color-bg-disabled-subtle);color:var(--alto-sem-color-fg-disabled-primary);cursor:not-allowed;pointer-events:none}._criticalQuaternary_1ajlh_253{background:none;color:var(--alto-sem-color-fg-critical-primary)}._criticalQuaternary_1ajlh_253[data-focused],._criticalQuaternary_1ajlh_253[data-hovered]{background:var(--alto-sem-color-bg-critical-subtle-hover)}._criticalQuaternary_1ajlh_253[data-pressed]{background:var(--alto-sem-color-bg-critical-subtle-active)}._criticalQuaternary_1ajlh_253[data-pressed][data-focused]{outline:none}._criticalQuaternary_1ajlh_253:disabled{color:var(--alto-sem-color-fg-disabled-primary);cursor:not-allowed;pointer-events:none}._neutralPrimary_1ajlh_278{background:var(--alto-sem-color-bg-inverse-vibrant-default);color:var(--alto-sem-color-fg-inverse-on-vibrant)}._neutralPrimary_1ajlh_278[data-focused],._neutralPrimary_1ajlh_278[data-hovered]{background:var(--alto-sem-color-bg-inverse-vibrant-hover)}._neutralPrimary_1ajlh_278[data-pressed]{background:var(--alto-sem-color-bg-inverse-vibrant-active)}._neutralPrimary_1ajlh_278[data-pressed][data-focused]{outline:none}._neutralPrimary_1ajlh_278:disabled{background:var(--alto-sem-color-bg-disabled-vibrant);cursor:not-allowed;pointer-events:none}._neutralSecondary_1ajlh_302{background:none;border:var(--alto-sem-border-width-sm) solid var(--alto-sem-color-border-inverse);color:var(--alto-sem-color-fg-inverse-on-subtle)}._neutralSecondary_1ajlh_302[data-focused],._neutralSecondary_1ajlh_302[data-hovered]{background:var(--alto-sem-color-bg-inverse-subtle-hover)}._neutralSecondary_1ajlh_302[data-pressed]{background:var(--alto-sem-color-bg-inverse-subtle-active)}._neutralSecondary_1ajlh_302[data-pressed][data-focused]{outline:none}._neutralSecondary_1ajlh_302:disabled{border:var(--alto-sem-border-width-sm) solid var(--alto-sem-color-border-disabled-vibrant);cursor:not-allowed;pointer-events:none}._neutralTertiary_1ajlh_327{background:var(--alto-sem-color-bg-inverse-subtle-default);color:var(--alto-sem-color-fg-primary)}._neutralTertiary_1ajlh_327[data-focused],._neutralTertiary_1ajlh_327[data-hovered]{background:var(--alto-sem-color-bg-inverse-subtle-hover)}._neutralTertiary_1ajlh_327[data-pressed]{background:var(--alto-sem-color-bg-inverse-subtle-active)}._neutralTertiary_1ajlh_327[data-pressed][data-focused]{outline:none}._neutralTertiary_1ajlh_327:disabled{background:var(--alto-sem-color-bg-disabled-subtle);color:var(--alto-sem-color-fg-disabled-primary);cursor:not-allowed;pointer-events:none}._neutralQuaternary_1ajlh_352{background:none;color:var(--alto-sem-color-fg-primary)}._neutralQuaternary_1ajlh_352[data-focused],._neutralQuaternary_1ajlh_352[data-hovered]{background:var(--alto-sem-color-bg-inverse-subtle-hover)}._neutralQuaternary_1ajlh_352[data-pressed]{background:var(--alto-sem-color-bg-inverse-subtle-active)}._neutralQuaternary_1ajlh_352[data-pressed][data-focused]{outline:none}._neutralQuaternary_1ajlh_352:disabled{background:none;color:var(--alto-sem-color-fg-disabled-primary);cursor:not-allowed;pointer-events:none}._whitePrimary_1ajlh_378{background:var(--alto-sem-color-bg-white-vibrant-default);color:var(--alto-sem-color-fg-white-on-vibrant)}._whitePrimary_1ajlh_378[data-focused],._whitePrimary_1ajlh_378[data-hovered]{background:var(--alto-sem-color-bg-white-vibrant-hover)}._whitePrimary_1ajlh_378[data-pressed]{background:var(--alto-sem-color-bg-white-vibrant-active)}._whitePrimary_1ajlh_378[data-pressed][data-focused]{outline:none}._whitePrimary_1ajlh_378:disabled{background:#ffffff52;color:var(--alto-sem-color-fg-disabled-on-vibrant);cursor:not-allowed;pointer-events:none}._whiteSecondary_1ajlh_403{background:none;border:var(--alto-sem-border-width-sm) solid var(--alto-sem-color-border-white);color:var(--alto-sem-color-fg-white-on-subtle)}._whiteSecondary_1ajlh_403[data-focused],._whiteSecondary_1ajlh_403[data-hovered]{background:var(--alto-sem-color-overlay-state-darken-hover)}._whiteSecondary_1ajlh_403[data-pressed]{background:var(--alto-sem-color-overlay-state-darken-active)}._whiteSecondary_1ajlh_403[data-pressed][data-focused]{outline:none}._whiteSecondary_1ajlh_403:focus-visible{outline-color:var(--alto-sem-color-border-white)}._whiteSecondary_1ajlh_403:disabled{border:var(--alto-sem-border-width-sm) solid hsla(0,0%,100%,.32);color:#ffffff52;cursor:not-allowed;pointer-events:none}._whiteTertiary_1ajlh_433{background:var(--alto-sem-color-bg-white-subtle-default);color:var(--alto-sem-color-fg-white-on-subtle)}._whiteTertiary_1ajlh_433[data-focused],._whiteTertiary_1ajlh_433[data-hovered]{background:var(--alto-sem-color-bg-white-subtle-hover)}._whiteTertiary_1ajlh_433[data-pressed]{background:var(--alto-sem-color-bg-white-subtle-active)}._whiteTertiary_1ajlh_433[data-pressed][data-focused]{outline:none}._whiteTertiary_1ajlh_433:focus-visible{outline-color:var(--alto-sem-color-border-white)}._whiteTertiary_1ajlh_433:disabled{background:#0000000d;color:#ffffff52;cursor:not-allowed;pointer-events:none}._whiteQuaternary_1ajlh_462{background:none;color:var(--alto-sem-color-fg-white-primary)}._whiteQuaternary_1ajlh_462[data-focused],._whiteQuaternary_1ajlh_462[data-hovered]{background:var(--alto-sem-color-bg-white-subtle-hover)}._whiteQuaternary_1ajlh_462[data-pressed]{background:var(--alto-sem-color-bg-white-subtle-active)}._whiteQuaternary_1ajlh_462[data-pressed][data-focused]{outline:none}._whiteQuaternary_1ajlh_462:focus-visible{outline-color:var(--alto-sem-color-border-white)}._whiteQuaternary_1ajlh_462:disabled{background:none;color:#ffffff52;cursor:not-allowed;pointer-events:none}._fa-spinner-third_1ajlh_493{height:1rem;width:1rem}._icon-wrapper_1ajlh_498{all:unset;align-items:center;display:flex;height:1em;justify-content:center;width:1em}
@@ -1,87 +0,0 @@
1
- import { ComponentType, ElementType } from 'react';
2
- import { AriaButtonOptions } from '@react-aria/button';
3
- export type NewButtonSize = 'lg' | 'md' | 'sm';
4
- export interface NewButtonProps<T extends ElementType> extends AriaButtonOptions<T> {
5
- /**
6
- * The HTML element to be rendered as the button.
7
- */
8
- as?: T;
9
- /**
10
- * What the base style of button is
11
- * @default 'accent'
12
- */
13
- styleType?: 'accent' | 'critical' | 'neutral' | 'white';
14
- /**
15
- * What the purpose is for the button
16
- * @default 'primary'
17
- */
18
- emphasis?: 'primary' | 'secondary' | 'tertiary' | 'quaternary';
19
- /**
20
- * How large should the button be?
21
- * @default 'md'
22
- */
23
- size?: NewButtonSize;
24
- /**
25
- * Whether the button leading has an icon
26
- */
27
- hasLeadingIcon?: boolean;
28
- /**
29
- * Leading icon name
30
- */
31
- leadingIconName?: string;
32
- /**
33
- * Whether the button trailing has an icon
34
- */
35
- hasTrailingIcon?: boolean;
36
- /**
37
- * Trailing icon name
38
- */
39
- trailingIconName?: string;
40
- /**
41
- * isLoading is a boolean that will show a spinner in the button
42
- */
43
- isLoading?: boolean;
44
- /**
45
- * The content for the button.
46
- */
47
- children?: React.ReactNode;
48
- /**
49
- * Whether the element should receive focus on render.
50
- */
51
- type?: 'button' | 'submit' | 'reset';
52
- /**
53
- * Whether the button should be full width.
54
- */
55
- fullWidth?: boolean;
56
- /**
57
- * @deprecated onPress should be preferred
58
- * Handler to be called when the button is clicked.
59
- */
60
- onClick?: React.MouseEventHandler;
61
- /**
62
- * The target of the link (if `as` is set to 'a').
63
- */
64
- target?: '_blank' | '_self' | '_parent' | '_top';
65
- /**
66
- * Handler to be called when the mouse enters the button.
67
- */
68
- onMouseEnter?: React.MouseEventHandler;
69
- /**
70
- * Handler to be called when the mouse leaves the button.
71
- */
72
- onMouseLeave?: React.MouseEventHandler;
73
- /**
74
- * Whether the button is disabled.
75
- */
76
- isDisabled?: boolean;
77
- /**
78
- * What type of focus style to apply to the button.
79
- */
80
- focusStyle?: 'default' | 'white';
81
- /**
82
- * Passthrough props for the button element.
83
- */
84
- passthroughProps?: Partial<T extends ComponentType<infer P> ? P : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : never>;
85
- }
86
- export declare const NewButton: <T extends ElementType = "button">({ as, styleType, emphasis, size, hasLeadingIcon, leadingIconName, hasTrailingIcon, trailingIconName, children, fullWidth, focusStyle, passthroughProps, isLoading, ...props }: NewButtonProps<T>) => import("react/jsx-runtime").JSX.Element;
87
- export default NewButton;
@@ -1,189 +0,0 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { c as cva } from "../../index-Bi3v_EjJ.js";
3
- import { useRef, useState } from "react";
4
- import { useButton } from "@react-aria/button";
5
- import { Icon } from "../Icon/Icon.js";
6
- import LoadingSpinner from "../LoadingSpinner/LoadingSpinner.js";
7
- import { focusStyleVariants } from "../../utils/focus/focusStyles.js";
8
- import '../../assets/NewButton.css';const newButton$1 = "_newButton_1ajlh_1";
9
- const content = "_content_1ajlh_23";
10
- const isNotLoading = "_isNotLoading_1ajlh_31";
11
- const loadingSpinner = "_loadingSpinner_1ajlh_31";
12
- const isLoading = "_isLoading_1ajlh_40";
13
- const focusWhite = "_focusWhite_1ajlh_52";
14
- const sm = "_sm_1ajlh_59";
15
- const md = "_md_1ajlh_64";
16
- const lg = "_lg_1ajlh_69";
17
- const fullWidth = "_fullWidth_1ajlh_74";
18
- const accentPrimary = "_accentPrimary_1ajlh_82";
19
- const accentSecondary = "_accentSecondary_1ajlh_101";
20
- const accentTertiary = "_accentTertiary_1ajlh_128";
21
- const accentQuaternary = "_accentQuaternary_1ajlh_153";
22
- const criticalPrimary = "_criticalPrimary_1ajlh_177";
23
- const criticalSecondary = "_criticalSecondary_1ajlh_201";
24
- const criticalTertiary = "_criticalTertiary_1ajlh_228";
25
- const criticalQuaternary = "_criticalQuaternary_1ajlh_253";
26
- const neutralPrimary = "_neutralPrimary_1ajlh_278";
27
- const neutralSecondary = "_neutralSecondary_1ajlh_302";
28
- const neutralTertiary = "_neutralTertiary_1ajlh_327";
29
- const neutralQuaternary = "_neutralQuaternary_1ajlh_352";
30
- const whitePrimary = "_whitePrimary_1ajlh_378";
31
- const whiteSecondary = "_whiteSecondary_1ajlh_403";
32
- const whiteTertiary = "_whiteTertiary_1ajlh_433";
33
- const whiteQuaternary = "_whiteQuaternary_1ajlh_462";
34
- const styles = {
35
- newButton: newButton$1,
36
- content,
37
- isNotLoading,
38
- loadingSpinner,
39
- isLoading,
40
- focusWhite,
41
- sm,
42
- md,
43
- lg,
44
- fullWidth,
45
- accentPrimary,
46
- accentSecondary,
47
- accentTertiary,
48
- accentQuaternary,
49
- criticalPrimary,
50
- criticalSecondary,
51
- criticalTertiary,
52
- criticalQuaternary,
53
- neutralPrimary,
54
- neutralSecondary,
55
- neutralTertiary,
56
- neutralQuaternary,
57
- whitePrimary,
58
- whiteSecondary,
59
- whiteTertiary,
60
- whiteQuaternary,
61
- "fa-spinner-third": "_fa-spinner-third_1ajlh_493",
62
- "icon-wrapper": "_icon-wrapper_1ajlh_498"
63
- };
64
- const newButton = cva(styles.newButton, {
65
- variants: {
66
- size: {
67
- sm: styles.sm,
68
- md: styles.md,
69
- lg: styles.lg
70
- },
71
- accent: {
72
- primary: styles.accentPrimary,
73
- secondary: styles.accentSecondary,
74
- tertiary: styles.accentTertiary,
75
- quaternary: styles.accentQuaternary
76
- },
77
- critical: {
78
- primary: styles.criticalPrimary,
79
- secondary: styles.criticalSecondary,
80
- tertiary: styles.criticalTertiary,
81
- quaternary: styles.criticalQuaternary
82
- },
83
- neutral: {
84
- primary: styles.neutralPrimary,
85
- secondary: styles.neutralSecondary,
86
- tertiary: styles.neutralTertiary,
87
- quaternary: styles.neutralQuaternary
88
- },
89
- white: {
90
- primary: styles.whitePrimary,
91
- secondary: styles.whiteSecondary,
92
- tertiary: styles.whiteTertiary,
93
- quaternary: styles.whiteQuaternary
94
- },
95
- fullWidth: {
96
- true: styles.fullWidth
97
- },
98
- focusStyle: {
99
- default: void 0,
100
- white: styles.focusWhite
101
- },
102
- isLoading: {
103
- false: styles.isNotLoading,
104
- true: styles.isLoading
105
- }
106
- },
107
- compoundVariants: [{
108
- size: "md",
109
- accent: "primary",
110
- className: styles.accentPrimary
111
- }],
112
- defaultVariants: {
113
- size: "md"
114
- }
115
- });
116
- const NewButton = ({
117
- as,
118
- styleType = "accent",
119
- emphasis = "primary",
120
- size = "md",
121
- hasLeadingIcon,
122
- leadingIconName = "circle",
123
- hasTrailingIcon,
124
- trailingIconName = "circle",
125
- children,
126
- fullWidth: fullWidth2,
127
- focusStyle = "default",
128
- passthroughProps,
129
- isLoading: isLoading2 = false,
130
- ...props
131
- }) => {
132
- const ref = useRef(null);
133
- const [isFocused, setIsFocused] = useState(false);
134
- const [isHovered, setIsHovered] = useState(false);
135
- const [isPressed, setIsPressed] = useState(false);
136
- const {
137
- buttonProps
138
- } = useButton({
139
- elementType: as,
140
- onFocus: (e) => {
141
- setIsFocused(true);
142
- if (props.onFocus) props.onFocus(e);
143
- },
144
- onBlur: (e) => {
145
- setIsFocused(false);
146
- if (props.onBlur) props.onBlur(e);
147
- },
148
- onPressStart: (e) => {
149
- setIsPressed(true);
150
- if (props.onPressStart) props.onPressStart(e);
151
- },
152
- onPressEnd: (e) => {
153
- setIsPressed(false);
154
- if (props.onPressEnd) props.onPressEnd(e);
155
- },
156
- ...props
157
- }, ref);
158
- const handleMouseEnter = (e) => {
159
- setIsHovered(true);
160
- if (props.onMouseEnter) props.onMouseEnter(e);
161
- };
162
- const handleMouseLeave = (e) => {
163
- setIsHovered(false);
164
- if (props.onMouseLeave) props.onMouseLeave(e);
165
- };
166
- const className = newButton({
167
- size,
168
- fullWidth: fullWidth2,
169
- focusStyle,
170
- isLoading: isLoading2,
171
- [styleType]: emphasis
172
- });
173
- const Component = as || "button";
174
- return /* @__PURE__ */ jsx(Component, { className: `${className} ${focusStyleVariants({
175
- focusStyle
176
- })}`, ref, "data-focused": isFocused ? true : void 0, "data-hovered": isHovered ? true : void 0, "data-pressed": isPressed ? true : void 0, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, "aria-label": isLoading2 ? "Loading Spinner" : buttonProps["aria-label"], "aria-live": isLoading2 ? "polite" : void 0, ...buttonProps, ...passthroughProps, children: /* @__PURE__ */ jsxs(Fragment, { children: [
177
- isLoading2 && /* @__PURE__ */ jsx(LoadingSpinner, { className: styles.loadingSpinner, size: size === "lg" ? "lg" : "1x", "aria-hidden": true }),
178
- /* @__PURE__ */ jsxs("span", { className: styles.content, children: [
179
- hasLeadingIcon && leadingIconName ? /* @__PURE__ */ jsx(Icon, { iconName: leadingIconName || "" }) : null,
180
- children,
181
- hasTrailingIcon && trailingIconName ? /* @__PURE__ */ jsx(Icon, { iconName: trailingIconName || "" }) : null
182
- ] })
183
- ] }) });
184
- };
185
- export {
186
- NewButton,
187
- NewButton as default
188
- };
189
- //# sourceMappingURL=NewButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NewButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- export { default } from './NewButton';
@@ -1,5 +0,0 @@
1
- import { NewButton } from "./NewButton.js";
2
- export {
3
- NewButton as default
4
- };
5
- //# sourceMappingURL=index.js.map