@juspay/svelte-ui-components 4.27.5 → 4.28.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 (164) hide show
  1. package/README.md +140 -36
  2. package/dist/Animations/ModalAnimation.svelte +15 -1
  3. package/dist/Animations/OverlayAnimation.svelte +7 -1
  4. package/dist/AreaChart/AreaChart.svelte +366 -85
  5. package/dist/AspectRatio/AspectRatio.svelte +51 -0
  6. package/dist/AspectRatio/AspectRatio.svelte.d.ts +3 -0
  7. package/dist/AspectRatio/properties.d.ts +27 -0
  8. package/dist/AspectRatio/properties.js +1 -0
  9. package/dist/Banner/Banner.svelte +10 -4
  10. package/dist/Banner/properties.d.ts +8 -0
  11. package/dist/BarChart/BarChart.svelte +156 -49
  12. package/dist/Book/Book.svelte +14 -1
  13. package/dist/BrandLoader/BrandLoader.svelte +76 -12
  14. package/dist/Button/Button.svelte +56 -11
  15. package/dist/Calendar/Calendar.svelte +88 -61
  16. package/dist/Card/Card.svelte +1 -1
  17. package/dist/Carousel/Carousel.svelte +6 -3
  18. package/dist/ChatComposer/ChatComposer.svelte +54 -4
  19. package/dist/ChatComposer/dictationState.d.ts +15 -0
  20. package/dist/ChatComposer/dictationState.js +9 -0
  21. package/dist/ChatComposer/properties.d.ts +28 -1
  22. package/dist/ChatMessage/ChatMessage.svelte +27 -1
  23. package/dist/CheckListItem/CheckListItem.svelte +3 -3
  24. package/dist/Checkbox/Checkbox.svelte +84 -3
  25. package/dist/Checkbox/properties.d.ts +45 -13
  26. package/dist/ChipInput/ChipInput.svelte +70 -3
  27. package/dist/ChipInput/properties.d.ts +16 -0
  28. package/dist/Choicebox/Choicebox.svelte +156 -1
  29. package/dist/Choicebox/group.d.ts +63 -0
  30. package/dist/Choicebox/group.js +127 -0
  31. package/dist/Choicebox/properties.d.ts +46 -0
  32. package/dist/ColorPicker/ColorPicker.svelte +169 -20
  33. package/dist/ColorPicker/properties.d.ts +16 -0
  34. package/dist/Combobox/Combobox.svelte +87 -25
  35. package/dist/Combobox/properties.d.ts +23 -0
  36. package/dist/CommandMenu/CommandMenu.svelte +27 -11
  37. package/dist/ContextMenu/ContextMenu.svelte +31 -37
  38. package/dist/DateRangePicker/DateRangePicker.svelte +171 -73
  39. package/dist/DeltaIndicator/DeltaIndicator.svelte +3 -3
  40. package/dist/Draggable/Draggable.svelte +12 -7
  41. package/dist/DualAxisBarChart/DualAxisBarChart.svelte +11 -4
  42. package/dist/EmptyState/EmptyState.svelte +1 -1
  43. package/dist/FileDropzoneTrigger/FileDropzoneTrigger.svelte +1 -1
  44. package/dist/FileInput/FileInput.svelte +50 -1
  45. package/dist/FileInput/properties.d.ts +7 -0
  46. package/dist/FunnelChart/FunnelChart.svelte +40 -12
  47. package/dist/FunnelChart/properties.d.ts +7 -1
  48. package/dist/Gallery/Gallery.svelte +20 -13
  49. package/dist/Gallery/properties.d.ts +8 -0
  50. package/dist/GridItem/GridItem.svelte +31 -1
  51. package/dist/HITL/HITL.svelte +35 -9
  52. package/dist/Icon/Icon.svelte +19 -3
  53. package/dist/Input/Input.svelte +24 -10
  54. package/dist/Input/properties.d.ts +37 -1
  55. package/dist/InputButton/InputButton.svelte +86 -11
  56. package/dist/InputButton/properties.d.ts +10 -1
  57. package/dist/Label/Label.svelte +54 -0
  58. package/dist/Label/Label.svelte.d.ts +3 -0
  59. package/dist/Label/properties.d.ts +26 -0
  60. package/dist/Label/properties.js +1 -0
  61. package/dist/LineChart/LineChart.svelte +385 -94
  62. package/dist/ListItem/ListItem.svelte +121 -15
  63. package/dist/Loader/Loader.svelte +22 -2
  64. package/dist/LoadingDots/LoadingDots.svelte +21 -0
  65. package/dist/MediaUpload/MediaUpload.svelte +13 -3
  66. package/dist/Menu/Menu.svelte +56 -28
  67. package/dist/Modal/Modal.svelte +77 -42
  68. package/dist/Pagination/Pagination.svelte +9 -2
  69. package/dist/Phone/Phone.svelte +4 -0
  70. package/dist/PieChart/PieChart.svelte +282 -38
  71. package/dist/PieChart/properties.d.ts +9 -0
  72. package/dist/Pill/Pill.svelte +14 -5
  73. package/dist/Progress/Progress.svelte +20 -0
  74. package/dist/Radio/Radio.svelte +58 -1
  75. package/dist/Radio/properties.d.ts +23 -0
  76. package/dist/RatingGroup/RatingGroup.svelte +283 -0
  77. package/dist/RatingGroup/RatingGroup.svelte.d.ts +4 -0
  78. package/dist/RatingGroup/properties.d.ts +73 -0
  79. package/dist/RatingGroup/properties.js +1 -0
  80. package/dist/RelativeTime/RelativeTime.svelte +1 -1
  81. package/dist/SankeyChart/SankeyChart.svelte +272 -50
  82. package/dist/SankeyChart/properties.d.ts +9 -0
  83. package/dist/Scroller/Scroller.svelte +37 -2
  84. package/dist/Select/Select.svelte +166 -46
  85. package/dist/Select/properties.d.ts +7 -0
  86. package/dist/Separator/Separator.svelte +48 -0
  87. package/dist/Separator/Separator.svelte.d.ts +3 -0
  88. package/dist/Separator/properties.d.ts +22 -0
  89. package/dist/Separator/properties.js +1 -0
  90. package/dist/Sheet/Sheet.svelte +60 -21
  91. package/dist/Shimmer/Shimmer.svelte +15 -0
  92. package/dist/Slider/Slider.svelte +87 -6
  93. package/dist/Slider/properties.d.ts +26 -0
  94. package/dist/Snippet/Snippet.svelte +4 -0
  95. package/dist/Snippet/copyState.svelte.d.ts +13 -1
  96. package/dist/Snippet/copyState.svelte.js +27 -1
  97. package/dist/Snippet/properties.d.ts +7 -0
  98. package/dist/SoundKit/SoundKit.js +9 -8
  99. package/dist/SplitInput/SplitInput.svelte +68 -2
  100. package/dist/SplitInput/properties.d.ts +23 -0
  101. package/dist/StatCard/StatCard.svelte +6 -6
  102. package/dist/Status/Status.svelte +2 -2
  103. package/dist/Stepper/Step.svelte +19 -6
  104. package/dist/Stepper/Stepper.svelte +108 -35
  105. package/dist/Table/BuiltinCell.svelte +2 -2
  106. package/dist/Table/Table.svelte +373 -55
  107. package/dist/Table/properties.d.ts +134 -3
  108. package/dist/Tabs/Tabs.svelte +263 -65
  109. package/dist/Tabs/properties.d.ts +23 -0
  110. package/dist/TaskList/TaskList.svelte +14 -5
  111. package/dist/ThemeSwitcher/ThemeSwitcher.svelte +23 -0
  112. package/dist/ThinkingIndicator/ThinkingIndicator.svelte +13 -5
  113. package/dist/Toast/Toast.svelte +27 -2
  114. package/dist/Toggle/Toggle.svelte +79 -7
  115. package/dist/Toggle/Toggle.svelte.d.ts +1 -1
  116. package/dist/Toggle/properties.d.ts +30 -7
  117. package/dist/ToolCallLog/ToolCallLog.svelte +59 -21
  118. package/dist/ToolCallLog/properties.d.ts +10 -0
  119. package/dist/Toolbar/Toolbar.svelte +1 -1
  120. package/dist/Tooltip/Tooltip.svelte +20 -2
  121. package/dist/Tooltip/tooltip-action.js +39 -4
  122. package/dist/TypewriterText/TypewriterText.svelte +34 -2
  123. package/dist/TypewriterText/properties.d.ts +18 -5
  124. package/dist/_chart/ChartContainer.svelte +12 -0
  125. package/dist/_chart/ChartTooltip.svelte +18 -4
  126. package/dist/_chart/Legend.svelte +21 -0
  127. package/dist/_chart/Legend.svelte.d.ts +15 -0
  128. package/dist/_chart/geometry.d.ts +54 -1
  129. package/dist/_chart/geometry.js +122 -14
  130. package/dist/_chart/interactions.d.ts +5 -1
  131. package/dist/_chart/interactions.js +9 -5
  132. package/dist/_chart/scales.js +16 -0
  133. package/dist/_chart/temporal.d.ts +45 -0
  134. package/dist/_chart/temporal.js +116 -0
  135. package/dist/_field/description.d.ts +50 -0
  136. package/dist/_field/description.js +51 -0
  137. package/dist/_interaction/dismissal.d.ts +67 -0
  138. package/dist/_interaction/dismissal.js +137 -0
  139. package/dist/_interaction/focus.d.ts +73 -0
  140. package/dist/_interaction/focus.js +143 -0
  141. package/dist/assets/star.svg +5 -0
  142. package/dist/index.d.ts +13 -1
  143. package/dist/index.js +21 -1
  144. package/dist/reduced-motion.svelte.d.ts +37 -0
  145. package/dist/reduced-motion.svelte.js +44 -0
  146. package/dist/styles/theme-dark.css +778 -0
  147. package/dist/types.d.ts +4 -2
  148. package/dist/utils.d.ts +62 -1
  149. package/dist/utils.js +80 -21
  150. package/dist-codemod/{bin.js → codemod/bin.js} +13 -2
  151. package/dist-codemod/{cli.js → codemod/cli.js} +48 -3
  152. package/dist-codemod/codemod/migrate-audit.js +395 -0
  153. package/dist-codemod/codemod/migration-assets/legacy-display.css +120 -0
  154. package/dist-codemod/codemod/migration-assets/legacy-palette.css +106 -0
  155. package/dist-codemod/codemod/migration-assets/wc-display.json +492 -0
  156. package/dist-codemod/migrate/analyze.js +804 -0
  157. package/dist-codemod/migrate/chart-tooltip-selector.js +301 -0
  158. package/dist-wc/index.js +13992 -4323
  159. package/package.json +13 -6
  160. package/dist/Modal/focus-trap.d.ts +0 -42
  161. package/dist/Modal/focus-trap.js +0 -57
  162. /package/dist-codemod/{legacy-pairs.js → codemod/legacy-pairs.js} +0 -0
  163. /package/dist-codemod/{transform.js → codemod/transform.js} +0 -0
  164. /package/dist-codemod/{wc-children.js → codemod/wc-children.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/svelte-ui-components",
3
- "version": "4.27.5",
3
+ "version": "4.28.0",
4
4
  "description": "A themeable Svelte 5 UI component library with CSS custom property driven styling",
5
5
  "keywords": [
6
6
  "svelte",
@@ -23,7 +23,7 @@
23
23
  "dev": "vite dev --host",
24
24
  "build": "vite build && npm run build:wc && npm run build:codemod && npm run package",
25
25
  "build:wc": "vite build --config vite.config.wc.ts && echo 'export {};' > dist-wc/index.d.ts",
26
- "build:codemod": "rm -rf dist-codemod && tsc -p scripts/codemod/tsconfig.build.json",
26
+ "build:codemod": "rm -rf dist-codemod && tsc -p scripts/codemod/tsconfig.build.json && node --experimental-strip-types scripts/codemod/generate-migration-assets.ts",
27
27
  "preview": "vite preview",
28
28
  "package": "svelte-kit sync && svelte-package && publint",
29
29
  "prepublishOnly": "npm run build:wc && npm run build:codemod && npm run package",
@@ -33,7 +33,7 @@
33
33
  "codemod": "node scripts/codemod/cli.ts",
34
34
  "check:wc": "svelte-check --tsconfig ./tsconfig.wc.json --compiler-warnings \"options_missing_custom_element:ignore\"",
35
35
  "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
36
- "lint": "prettier --check src scripts tests && eslint src scripts tests && npm run lint:event-casing",
36
+ "lint": "prettier --check src scripts tests && eslint src scripts tests && npm run lint:event-casing && npm run lint:shadow-safety && npm run lint:css-contract && npm run lint:docs-contract && npm run lint:wc-contract && npm run lint:test-focus",
37
37
  "lint:event-casing": "node scripts/check-event-casing.js",
38
38
  "format": "prettier --write src scripts tests",
39
39
  "test:integration": "playwright test",
@@ -44,7 +44,13 @@
44
44
  "check:migrate": "tsc -p scripts/migrate/tsconfig.json",
45
45
  "check:release": "tsc -p scripts/release/tsconfig.json",
46
46
  "check:wc-parity": "tsc -p scripts/wc-parity/tsconfig.json",
47
- "postinstall": "node scripts/postinstall.mjs"
47
+ "postinstall": "node scripts/postinstall.mjs",
48
+ "lint:shadow-safety": "node scripts/check-shadow-safety.js",
49
+ "lint:css-contract": "node scripts/check-css-contract.js",
50
+ "lint:docs-contract": "node scripts/check-docs-contract.js",
51
+ "lint:wc-contract": "node scripts/check-wc-contract.js",
52
+ "lint:test-focus": "node scripts/check-test-focus.js",
53
+ "test:walkthrough": "playwright test --config playwright.walkthrough.config.ts"
48
54
  },
49
55
  "exports": {
50
56
  ".": {
@@ -54,7 +60,8 @@
54
60
  "./wc": {
55
61
  "types": "./dist-wc/index.d.ts",
56
62
  "default": "./dist-wc/index.js"
57
- }
63
+ },
64
+ "./theme-dark.css": "./dist/styles/theme-dark.css"
58
65
  },
59
66
  "files": [
60
67
  "dist",
@@ -197,7 +204,7 @@
197
204
  }
198
205
  },
199
206
  "bin": {
200
- "sui-codemod": "./dist-codemod/bin.js"
207
+ "sui-codemod": "./dist-codemod/codemod/bin.js"
201
208
  },
202
209
  "engines": {
203
210
  "node": ">=22.18"
@@ -1,42 +0,0 @@
1
- /**
2
- * Focus-trap utility for Modal (#529). Pure DOM-reading functions, no Svelte
3
- * runtime dependency, so they can be unit tested without mounting the
4
- * component -- mirrors the split Tooltip already uses for its action logic
5
- * (see tooltip-action.test.ts).
6
- *
7
- * Modal.svelte owns the event wiring (which key was pressed, calling
8
- * .focus()); this module owns the two decisions that wiring needs answered:
9
- * "what are the edges of the tab order in here" and "given where focus is and
10
- * which way Tab was pressed, should it wrap, and to where".
11
- */
12
- export type FocusTrapBoundary = {
13
- readonly first: HTMLElement | null;
14
- readonly last: HTMLElement | null;
15
- };
16
- /**
17
- * The first and last focusable descendants of `container`, in DOM order.
18
- * Both are null when the container is null or holds nothing focusable.
19
- */
20
- export declare function getFocusTrapBoundary(container: ParentNode | null): FocusTrapBoundary;
21
- /**
22
- * Given a Tab/Shift+Tab keydown inside a focus-trapped container, returns the
23
- * element focus should move to, or null when the default browser behavior
24
- * (move to the next/previous focusable element) should be left alone.
25
- *
26
- * Wrapping only happens exactly at an edge: focus sits on the last focusable
27
- * element and Tab (not Shift+Tab) was pressed, or focus sits on the first and
28
- * Shift+Tab was pressed. Anywhere else in the middle of the tab order, the
29
- * browser's own handling is correct and this returns null.
30
- */
31
- export declare function focusTrapTabTarget(params: {
32
- readonly container: ParentNode | null;
33
- readonly activeElement: Element | null;
34
- readonly shiftKey: boolean;
35
- }): HTMLElement | null;
36
- /**
37
- * Moves focus into `container` -- its first focusable descendant, or the
38
- * container itself as a fallback for a modal with no focusable content (it
39
- * must carry tabindex="-1" for that fallback to actually take focus). A no-op
40
- * when the container is null.
41
- */
42
- export declare function focusEntryPoint(container: HTMLElement | null): void;
@@ -1,57 +0,0 @@
1
- /**
2
- * Focus-trap utility for Modal (#529). Pure DOM-reading functions, no Svelte
3
- * runtime dependency, so they can be unit tested without mounting the
4
- * component -- mirrors the split Tooltip already uses for its action logic
5
- * (see tooltip-action.test.ts).
6
- *
7
- * Modal.svelte owns the event wiring (which key was pressed, calling
8
- * .focus()); this module owns the two decisions that wiring needs answered:
9
- * "what are the edges of the tab order in here" and "given where focus is and
10
- * which way Tab was pressed, should it wrap, and to where".
11
- */
12
- const FOCUSABLE_SELECTOR = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
13
- /**
14
- * The first and last focusable descendants of `container`, in DOM order.
15
- * Both are null when the container is null or holds nothing focusable.
16
- */
17
- export function getFocusTrapBoundary(container) {
18
- if (container === null) {
19
- return { first: null, last: null };
20
- }
21
- const focusable = container.querySelectorAll(FOCUSABLE_SELECTOR);
22
- return { first: focusable.item(0), last: focusable.item(focusable.length - 1) };
23
- }
24
- /**
25
- * Given a Tab/Shift+Tab keydown inside a focus-trapped container, returns the
26
- * element focus should move to, or null when the default browser behavior
27
- * (move to the next/previous focusable element) should be left alone.
28
- *
29
- * Wrapping only happens exactly at an edge: focus sits on the last focusable
30
- * element and Tab (not Shift+Tab) was pressed, or focus sits on the first and
31
- * Shift+Tab was pressed. Anywhere else in the middle of the tab order, the
32
- * browser's own handling is correct and this returns null.
33
- */
34
- export function focusTrapTabTarget(params) {
35
- const { first, last } = getFocusTrapBoundary(params.container);
36
- if (first === null || last === null) {
37
- return null;
38
- }
39
- const edge = params.shiftKey ? first : last;
40
- if (params.activeElement !== edge) {
41
- return null;
42
- }
43
- return params.shiftKey ? last : first;
44
- }
45
- /**
46
- * Moves focus into `container` -- its first focusable descendant, or the
47
- * container itself as a fallback for a modal with no focusable content (it
48
- * must carry tabindex="-1" for that fallback to actually take focus). A no-op
49
- * when the container is null.
50
- */
51
- export function focusEntryPoint(container) {
52
- if (container === null) {
53
- return;
54
- }
55
- const { first } = getFocusTrapBoundary(container);
56
- (first ?? container).focus();
57
- }