@veracity/vui 5.2.0-alpha.398622.2606110819 → 5.2.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 (72) hide show
  1. package/dist/badge/badge.d.ts.map +1 -1
  2. package/dist/badge/badge.js +1 -8
  3. package/dist/badge/badge.js.map +1 -1
  4. package/dist/button/buttonText.js +1 -1
  5. package/dist/button/buttons.d.ts +1 -2
  6. package/dist/button/buttons.d.ts.map +1 -1
  7. package/dist/button/buttons.js +5 -21
  8. package/dist/button/buttons.js.map +1 -1
  9. package/dist/button/index.d.ts +1 -1
  10. package/dist/dialog/dialogCloseButton.js +1 -1
  11. package/dist/dialog/dialogCloseButton.js.map +1 -1
  12. package/dist/dismissButton/DismissButton.d.ts +34 -0
  13. package/dist/dismissButton/DismissButton.d.ts.map +1 -0
  14. package/dist/dismissButton/DismissButton.js +69 -0
  15. package/dist/dismissButton/DismissButton.js.map +1 -0
  16. package/dist/dismissButton/index.d.ts +1 -0
  17. package/dist/dismissButton/theme.js +33 -0
  18. package/dist/dismissButton/theme.js.map +1 -0
  19. package/dist/header/loggedInHeader.js +1 -1
  20. package/dist/index.d.ts +6 -5
  21. package/dist/index.js +10 -9
  22. package/dist/notification/index.d.ts +1 -1
  23. package/dist/notification/notification.d.ts.map +1 -1
  24. package/dist/notification/notification.js +27 -6
  25. package/dist/notification/notification.js.map +1 -1
  26. package/dist/notification/notification.types.d.ts +26 -7
  27. package/dist/notification/notification.types.d.ts.map +1 -1
  28. package/dist/notification/notificationAction.d.ts.map +1 -1
  29. package/dist/notification/notificationAction.js +6 -1
  30. package/dist/notification/notificationAction.js.map +1 -1
  31. package/dist/notification/theme.js +25 -10
  32. package/dist/notification/theme.js.map +1 -1
  33. package/dist/notification/utils.js +39 -10
  34. package/dist/notification/utils.js.map +1 -1
  35. package/dist/range/index.d.ts +1 -1
  36. package/dist/range/range.d.ts.map +1 -1
  37. package/dist/range/range.js +93 -51
  38. package/dist/range/range.js.map +1 -1
  39. package/dist/range/range.types.d.ts +2 -3
  40. package/dist/range/range.types.d.ts.map +1 -1
  41. package/dist/range/theme.js +1 -5
  42. package/dist/range/theme.js.map +1 -1
  43. package/dist/stepIndicator/stepIndicator.js +1 -0
  44. package/dist/stepIndicator/stepIndicator.js.map +1 -1
  45. package/dist/tabs/tabsNavBar.js +2 -2
  46. package/dist/tabs/tabsNavBar.js.map +1 -1
  47. package/dist/tag/index.d.ts +1 -1
  48. package/dist/tag/tag.d.ts.map +1 -1
  49. package/dist/tag/tag.js +4 -4
  50. package/dist/tag/tag.js.map +1 -1
  51. package/dist/tag/tag.types.d.ts +9 -9
  52. package/dist/tag/tag.types.d.ts.map +1 -1
  53. package/dist/tag/theme.js +13 -33
  54. package/dist/tag/theme.js.map +1 -1
  55. package/dist/tag/utils.d.ts +7 -7
  56. package/dist/tag/utils.d.ts.map +1 -1
  57. package/dist/tag/utils.js +8 -8
  58. package/dist/tag/utils.js.map +1 -1
  59. package/dist/theme/components.d.ts +33 -16
  60. package/dist/theme/components.js +88 -86
  61. package/dist/theme/components.js.map +1 -1
  62. package/dist/theme/defaultTheme.d.ts +33 -16
  63. package/dist/theme/types.d.ts +3 -1
  64. package/dist/theme/types.d.ts.map +1 -1
  65. package/dist/toast/useToast.d.ts.map +1 -1
  66. package/dist/toast/useToast.js +2 -0
  67. package/dist/toast/useToast.js.map +1 -1
  68. package/dist/tutorial/tutorialCard.js +2 -1
  69. package/dist/tutorial/tutorialCard.js.map +1 -1
  70. package/package.json +5 -3
  71. package/skills/build-with-vui/SKILL.md +1 -1
  72. package/skills/upgrade-vui-v4-to-v5/SKILL.md +8 -7
@@ -1 +1 @@
1
- {"version":3,"file":"notification.js","names":["shadows"],"sources":["../../src/notification/notification.tsx"],"sourcesContent":["import Box from '../box'\nimport { DismissButton } from '../button'\nimport type { VuiComponent } from '../core'\nimport { styled, useStyleConfig, vui } from '../core'\nimport shadows from '../theme/foundations/shadows'\nimport { cs, filterUndefined, isReactText, isString } from '../utils'\nimport { INTENT_ICON_MAP, notificationStatusMapping, LOADING_ICON_PROPS } from './consts'\nimport { NotificationProvider } from './context'\nimport type { NotificationProps } from './notification.types'\nimport NotificationAction from './notificationAction'\nimport NotificationIcon from './notificationIcon'\nimport NotificationText from './notificationText'\nimport NotificationTitle from './notificationTitle'\nimport { resolveNotificationVariant, DEFAULT_VARIANT } from './utils'\n\nconst linkSwipeAnimation = `\n @keyframes linkSwipe {\n from {\n background-size: 0 1px;\n }\n to {\n background-size: 100% 1px;\n }\n }\n`\n\nconst NotificationContainer = styled(Box)<{ $dismissFg?: string; $isBanner?: boolean }>`\n ${({ $dismissFg }) => $dismissFg && `--vui-dismiss-fg: ${$dismissFg};`}\n ${linkSwipeAnimation}\n .vui-notificationText a {\n text-decoration: none;\n background: linear-gradient(to right, currentColor, currentColor);\n background-size: 100% 1px;\n background-position: 0 100%;\n background-repeat: no-repeat;\n padding-bottom: 2px;\n }\n .vui-notificationText a:hover {\n animation: linkSwipe 0.5s ease forwards;\n background-size: 100% 1px;\n }\n ${({ $isBanner }) =>\n $isBanner &&\n `\n box-shadow: ${shadows.md};\n position: relative;\n width: 100%;\n border: none;\n `}\n`\n\n/**\n * Displays informational content, like text and icon with optional action buttons.\n * Handles multiple states, like info, error or loading.\n */\nexport const Notification = vui<'div', NotificationProps>((props, ref) => {\n const {\n action,\n children,\n className,\n icon,\n intent,\n isLoading,\n onClose,\n showDismissButton,\n size,\n status,\n statusMapping,\n text,\n title,\n variant: variantProp = DEFAULT_VARIANT,\n align,\n verticalAlign,\n ...rest\n } = props\n\n const statuses = { ...notificationStatusMapping, ...statusMapping }\n\n // Derive variant/intent/isLoading from deprecated status prop when not explicitly set.\n // Explicit props always win; status is a convenience shorthand only.\n const statusProps = status ? statuses[status] : undefined\n const resolvedVariant = variantProp !== DEFAULT_VARIANT ? variantProp : (statusProps?.variant ?? variantProp)\n const resolvedIntent = intent ?? statusProps?.intent\n const resolvedIsLoading = isLoading ?? statusProps?.isLoading\n\n const { themeKey, isBanner } = resolveNotificationVariant(resolvedVariant, resolvedIntent)\n\n const styles = useStyleConfig('Notification', { variant: themeKey, size })\n\n // Auto-inject icon only when using the default render path (no custom children).\n // When children are provided, the consumer manages icons via <Notification.Icon>.\n // An explicit string `icon` prop always wins regardless of children.\n // Priority: explicit icon → loading → status mapping → intent mapping\n const autoIconProps = resolvedIsLoading\n ? LOADING_ICON_PROPS\n : (statuses[status ?? '']?.iconProps ?? (resolvedIntent ? INTENT_ICON_MAP[resolvedIntent] : undefined))\n\n const showIcon = icon !== ''\n const iconName = showIcon ? (isString(icon) ? icon : (!children && autoIconProps?.name) || undefined) : undefined\n\n const context = filterUndefined<NotificationProps>({\n size,\n status,\n statusMapping,\n variant: themeKey,\n intent: resolvedIntent,\n isLoading: resolvedIsLoading,\n })\n\n // verticalAlign is deprecated; map old values to the new align prop\n const resolvedAlign =\n align ?? (verticalAlign === 'center' ? 'center' : verticalAlign === 'flex-start' ? 'top' : undefined)\n const alignSelf = resolvedAlign === 'center' ? 'center' : 'flex-start'\n\n return (\n <NotificationProvider value={context}>\n <NotificationContainer\n borderRadius=\"md\"\n borderWidth={1}\n className={cs('vui-notification', className)}\n ref={ref}\n role=\"status\"\n w=\"fit-content\"\n $dismissFg={styles.container?.['--vui-dismiss-fg']}\n $isBanner={isBanner}\n {...styles.container}\n {...rest}\n >\n {iconName ? (\n <Box alignSelf={alignSelf} {...styles.icon}>\n <NotificationIcon {...autoIconProps} name={iconName} />\n </Box>\n ) : showIcon ? (\n icon\n ) : null}\n\n {children ?? (\n <Box column={alignSelf !== 'center'} flex={1} {...styles.content}>\n <NotificationText>\n {title ? (\n isReactText(title) ? (\n <NotificationTitle\n display={alignSelf !== 'center' ? 'block' : 'inline'}\n mb={alignSelf !== 'center' && text ? styles.title?.mb : undefined}\n text={title}\n />\n ) : (\n title\n )\n ) : null}\n {title && text && alignSelf === 'center' ? ' ' : null}\n {text}\n </NotificationText>\n {action ? <NotificationAction>{action}</NotificationAction> : null}\n </Box>\n )}\n\n {showDismissButton && (\n <DismissButton\n alignSelf={alignSelf}\n aria-label=\"Close\"\n size=\"md\"\n onClick={onClose || (() => {})}\n {...styles.button}\n />\n )}\n </NotificationContainer>\n </NotificationProvider>\n )\n}) as VuiComponent<'div', NotificationProps> & {\n Action: typeof NotificationAction\n Icon: typeof NotificationIcon\n Text: typeof NotificationText\n Title: typeof NotificationTitle\n}\n\nNotification.Action = NotificationAction\nNotification.Icon = NotificationIcon\nNotification.Text = NotificationText\nNotification.Title = NotificationTitle\nNotification.displayName = 'Notification'\n\nexport default Notification\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0BA,MAAM,wBAAwB,OAAO,GAAG,CAAC,AAA8C;KAClF,EAAE,iBAAiB,cAAc,qBAAqB,WAAW,GAAG;IACrE;;;;;;;;;EAAmB;;;;;;;;;;;;;KAalB,EAAE,gBACH,aACA;kBACcA,gBAAQ,GAAG;;;;IAIzB;;;;;;AAOJ,MAAa,eAAe,KAA+B,OAAO,QAAQ;CACxE,MAAM,EACJ,QACA,UACA,WACA,MACA,QACA,WACA,SACA,mBACA,MACA,QACA,eACA,MACA,OACA,SAAS,cAAc,iBACvB,OACA,eACA,GAAG,SACD;CAEJ,MAAM,WAAW;EAAE,GAAG;EAA2B,GAAG;CAAc;CAIlE,MAAM,cAAc,SAAS,SAAS,UAAU;CAChD,MAAM,kBAAkB,2BAAkC,cAAe,aAAa,WAAW;CACjG,MAAM,iBAAiB,UAAU,aAAa;CAC9C,MAAM,oBAAoB,aAAa,aAAa;CAEpD,MAAM,EAAE,UAAU,aAAa,2BAA2B,iBAAiB,cAAc;CAEzF,MAAM,SAAS,eAAe,gBAAgB;EAAE,SAAS;EAAU;CAAK,CAAC;CAMzE,MAAM,gBAAgB,oBAClB,qBACC,SAAS,UAAU,GAAG,EAAE,cAAc,iBAAiB,gBAAgB,kBAAkB;CAE9F,MAAM,WAAW,SAAS;CAC1B,MAAM,WAAW,WAAY,SAAS,IAAI,IAAI,OAAQ,CAAC,YAAY,eAAe,QAAS,SAAa;CAExG,MAAM,UAAU,gBAAmC;EACjD;EACA;EACA;EACA,SAAS;EACT,QAAQ;EACR,WAAW;CACb,CAAC;CAKD,MAAM,aADJ,UAAU,kBAAkB,WAAW,WAAW,kBAAkB,eAAe,QAAQ,aACzD,WAAW,WAAW;CAE1D,OACE,oBAAC,sBAAD;EAAsB,OAAO;YAC3B,qBAAC,uBAAD;GACE,cAAa;GACb,aAAa;GACb,WAAW,GAAG,oBAAoB,SAAS;GACtC;GACL,MAAK;GACL,GAAE;GACF,YAAY,OAAO,YAAY;GAC/B,WAAW;GACX,GAAI,OAAO;GACX,GAAI;aAVN;IAYG,WACC,oBAAC,KAAD;KAAgB;KAAW,GAAI,OAAO;eACpC,oBAAC,kBAAD;MAAkB,GAAI;MAAe,MAAM;KAAW;IACnD,KACH,WACF,OACE;IAEH,YACC,qBAAC,KAAD;KAAK,QAAQ,cAAc;KAAU,MAAM;KAAG,GAAI,OAAO;eAAzD,CACE,qBAAC,kBAAD;MACG,QACC,YAAY,KAAK,IACf,oBAAC,mBAAD;OACE,SAAS,cAAc,WAAW,UAAU;OAC5C,IAAI,cAAc,YAAY,OAAO,OAAO,OAAO,KAAK;OACxD,MAAM;MACP,KAED,QAEA;MACH,SAAS,QAAQ,cAAc,WAAW,MAAM;MAChD;KACe,MACjB,SAAS,oBAAC,oBAAD,YAAqB,OAA2B,KAAI,IAC3D;;IAGN,qBACC,oBAAC,eAAD;KACa;KACX,cAAW;KACX,MAAK;KACL,SAAS,kBAAkB,CAAC;KAC5B,GAAI,OAAO;IACZ;GAEkB;;CACH;AAE1B,CAAC;AAOD,aAAa,SAAS;AACtB,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,QAAQ;AACrB,aAAa,cAAc"}
1
+ {"version":3,"file":"notification.js","names":["shadows"],"sources":["../../src/notification/notification.tsx"],"sourcesContent":["import Box from '../box'\nimport type { VuiComponent } from '../core'\nimport { styled, useStyleConfig, vui } from '../core'\nimport { DismissButton } from '../dismissButton'\nimport shadows from '../theme/foundations/shadows'\nimport { cs, filterUndefined, isReactText, isString } from '../utils'\nimport { INTENT_ICON_MAP, notificationStatusMapping, LOADING_ICON_PROPS } from './consts'\nimport { NotificationProvider } from './context'\nimport type { NotificationProps } from './notification.types'\nimport NotificationAction from './notificationAction'\nimport NotificationIcon from './notificationIcon'\nimport NotificationText from './notificationText'\nimport NotificationTitle from './notificationTitle'\nimport {\n DEFAULT_VARIANT,\n inferNotificationLayout,\n resolveNotificationAria,\n resolveNotificationVariant,\n} from './utils'\n\nconst linkSwipeAnimation = `\n @keyframes linkSwipe {\n from {\n background-size: 0 1px;\n }\n to {\n background-size: 100% 1px;\n }\n }\n`\n\nconst NotificationContainer = styled(Box)<{ $dismissFg?: string; $isBanner?: boolean }>`\n ${({ $dismissFg }) => $dismissFg && `--vui-dismiss-fg: ${$dismissFg};`}\n ${linkSwipeAnimation}\n .vui-notificationText a {\n text-decoration: none;\n background: linear-gradient(to right, currentColor, currentColor);\n background-size: 100% 1px;\n background-position: 0 100%;\n background-repeat: no-repeat;\n padding-bottom: 2px;\n }\n .vui-notificationText a:hover {\n animation: linkSwipe 0.5s ease forwards;\n background-size: 100% 1px;\n }\n ${({ $isBanner }) =>\n $isBanner &&\n `\n box-shadow: ${shadows.md};\n position: relative;\n width: 100%;\n border: none;\n `}\n`\n\n/**\n * Displays informational content, like text and icon with optional action buttons.\n * Handles multiple states, like info, error or loading.\n */\nexport const Notification = vui<'div', NotificationProps>((props, ref) => {\n const {\n action,\n align,\n ariaLive,\n children,\n className,\n icon,\n intent,\n isLoading,\n onClose,\n role,\n showDismissButton,\n size,\n status,\n statusMapping,\n text,\n title,\n variant: variantProp = DEFAULT_VARIANT,\n verticalAlign,\n ...rest\n } = props\n\n const statuses = { ...notificationStatusMapping, ...statusMapping }\n\n // Derive variant/intent/isLoading from deprecated status prop when not explicitly set.\n // Explicit props always win; status is a convenience shorthand only.\n const statusProps = status ? statuses[status] : undefined\n const resolvedVariant = variantProp !== DEFAULT_VARIANT ? variantProp : (statusProps?.variant ?? variantProp)\n // Q9: when isLoading is true, default intent to 'info' if not specified.\n const intentFromProps = intent ?? statusProps?.intent\n const resolvedIsLoading = isLoading ?? statusProps?.isLoading\n const resolvedIntent = resolvedIsLoading && intentFromProps == null ? 'info' : intentFromProps\n\n const { themeKey, isBanner } = resolveNotificationVariant(resolvedVariant, resolvedIntent)\n\n // Q2: infer layout from content composition; no `layout` prop.\n const layout = inferNotificationLayout({ action, text, title, hasStatus: !!statusProps })\n\n // Q4: auto-map role/aria-live from intent (and isLoading). Explicit props win.\n const aria = resolveNotificationAria({ intent: resolvedIntent, isLoading: resolvedIsLoading })\n const resolvedRole = role ?? aria.role\n const resolvedAriaLive = ariaLive ?? aria.ariaLive\n\n const styles = useStyleConfig('Notification', { variant: themeKey, size })\n\n // Auto-inject icon only when using the default render path (no custom children).\n // When children are provided, the consumer manages icons via <Notification.Icon>.\n // An explicit string `icon` prop always wins regardless of children.\n // Priority: explicit icon → loading → status mapping → intent mapping\n const autoIconProps = resolvedIsLoading\n ? LOADING_ICON_PROPS\n : (statuses[status ?? '']?.iconProps ?? (resolvedIntent ? INTENT_ICON_MAP[resolvedIntent] : undefined))\n\n const showIcon = icon !== ''\n const iconName = showIcon ? (isString(icon) ? icon : (!children && autoIconProps?.name) || undefined) : undefined\n\n const context = filterUndefined<NotificationProps>({\n size,\n status,\n statusMapping,\n variant: themeKey,\n intent: resolvedIntent,\n isLoading: resolvedIsLoading,\n })\n // Q10: expose the inferred layout to Notification.Action via context.\n // Use a non-prop key so the context payload doesn't pollute NotificationProps consumers.\n ;(context as Record<string, unknown>).layout = layout\n\n // verticalAlign is deprecated; map old values to the new align prop\n const resolvedAlign =\n align ?? (verticalAlign === 'center' ? 'center' : verticalAlign === 'flex-start' ? 'top' : undefined)\n // Q11: align is the only manual override. When omitted, fall back to layout-driven default.\n const layoutDefaultAlign = layout === 'one-line' ? 'center' : 'top'\n const alignSelf = (resolvedAlign ?? layoutDefaultAlign) === 'center' ? 'center' : 'flex-start'\n\n return (\n <NotificationProvider value={context}>\n <NotificationContainer\n borderRadius=\"md\"\n borderWidth={1}\n className={cs('vui-notification', className)}\n ref={ref}\n role={resolvedRole}\n aria-live={resolvedAriaLive}\n data-intent={resolvedIntent}\n data-variant={isBanner ? 'banner' : 'inline'}\n data-layout={layout}\n data-loading={resolvedIsLoading ? 'true' : undefined}\n data-align={resolvedAlign}\n w=\"fit-content\"\n $dismissFg={styles.container?.['--vui-dismiss-fg']}\n $isBanner={isBanner}\n {...styles.container}\n {...rest}\n >\n {iconName ? (\n <Box alignSelf={alignSelf} {...styles.icon}>\n <NotificationIcon {...autoIconProps} name={iconName} />\n </Box>\n ) : showIcon ? (\n icon\n ) : null}\n\n {children ?? (\n <Box column={alignSelf !== 'center'} flex={1} {...styles.content}>\n <NotificationText>\n {title ? (\n isReactText(title) ? (\n <NotificationTitle\n display={alignSelf !== 'center' ? 'block' : 'inline'}\n mb={alignSelf !== 'center' && text ? styles.title?.mb : undefined}\n text={title}\n />\n ) : (\n title\n )\n ) : null}\n {title && text && alignSelf === 'center' ? ' ' : null}\n {text}\n </NotificationText>\n {action ? <NotificationAction>{action}</NotificationAction> : null}\n </Box>\n )}\n\n {showDismissButton && (\n <DismissButton\n alignSelf={alignSelf}\n aria-label=\"Close\"\n size=\"md\"\n onClick={onClose || (() => {})}\n {...styles.button}\n />\n )}\n </NotificationContainer>\n </NotificationProvider>\n )\n}) as VuiComponent<'div', NotificationProps> & {\n Action: typeof NotificationAction\n Icon: typeof NotificationIcon\n Text: typeof NotificationText\n Title: typeof NotificationTitle\n}\n\nNotification.Action = NotificationAction\nNotification.Icon = NotificationIcon\nNotification.Text = NotificationText\nNotification.Title = NotificationTitle\nNotification.displayName = 'Notification'\n\nexport default Notification\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA+BA,MAAM,wBAAwB,OAAO,GAAG,CAAC,AAA8C;KAClF,EAAE,iBAAiB,cAAc,qBAAqB,WAAW,GAAG;IACrE;;;;;;;;;EAAmB;;;;;;;;;;;;;KAalB,EAAE,gBACH,aACA;kBACcA,gBAAQ,GAAG;;;;IAIzB;;;;;;AAOJ,MAAa,eAAe,KAA+B,OAAO,QAAQ;CACxE,MAAM,EACJ,QACA,OACA,UACA,UACA,WACA,MACA,QACA,WACA,SACA,MACA,mBACA,MACA,QACA,eACA,MACA,OACA,SAAS,cAAc,iBACvB,eACA,GAAG,SACD;CAEJ,MAAM,WAAW;EAAE,GAAG;EAA2B,GAAG;CAAc;CAIlE,MAAM,cAAc,SAAS,SAAS,UAAU;CAChD,MAAM,kBAAkB,2BAAkC,cAAe,aAAa,WAAW;CAEjG,MAAM,kBAAkB,UAAU,aAAa;CAC/C,MAAM,oBAAoB,aAAa,aAAa;CACpD,MAAM,iBAAiB,qBAAqB,mBAAmB,OAAO,SAAS;CAE/E,MAAM,EAAE,UAAU,aAAa,2BAA2B,iBAAiB,cAAc;CAGzF,MAAM,SAAS,wBAAwB;EAAE;EAAQ;EAAM;EAAO,WAAW,CAAC,CAAC;CAAY,CAAC;CAGxF,MAAM,OAAO,wBAAwB;EAAE,QAAQ;EAAgB,WAAW;CAAkB,CAAC;CAC7F,MAAM,eAAe,QAAQ,KAAK;CAClC,MAAM,mBAAmB,YAAY,KAAK;CAE1C,MAAM,SAAS,eAAe,gBAAgB;EAAE,SAAS;EAAU;CAAK,CAAC;CAMzE,MAAM,gBAAgB,oBAClB,qBACC,SAAS,UAAU,GAAG,EAAE,cAAc,iBAAiB,gBAAgB,kBAAkB;CAE9F,MAAM,WAAW,SAAS;CAC1B,MAAM,WAAW,WAAY,SAAS,IAAI,IAAI,OAAQ,CAAC,YAAY,eAAe,QAAS,SAAa;CAExG,MAAM,UAAU,gBAAmC;EACjD;EACA;EACA;EACA,SAAS;EACT,QAAQ;EACR,WAAW;CACb,CAAC;CAGA,AAAC,QAAoC,SAAS;CAG/C,MAAM,gBACJ,UAAU,kBAAkB,WAAW,WAAW,kBAAkB,eAAe,QAAQ;CAG7F,MAAM,aAAa,kBADQ,WAAW,aAAa,WAAW,YACF,WAAW,WAAW;CAElF,OACE,oBAAC,sBAAD;EAAsB,OAAO;YAC3B,qBAAC,uBAAD;GACE,cAAa;GACb,aAAa;GACb,WAAW,GAAG,oBAAoB,SAAS;GACtC;GACL,MAAM;GACN,aAAW;GACX,eAAa;GACb,gBAAc,WAAW,WAAW;GACpC,eAAa;GACb,gBAAc,oBAAoB,SAAS;GAC3C,cAAY;GACZ,GAAE;GACF,YAAY,OAAO,YAAY;GAC/B,WAAW;GACX,GAAI,OAAO;GACX,GAAI;aAhBN;IAkBG,WACC,oBAAC,KAAD;KAAgB;KAAW,GAAI,OAAO;eACpC,oBAAC,kBAAD;MAAkB,GAAI;MAAe,MAAM;KAAW;IACnD,KACH,WACF,OACE;IAEH,YACC,qBAAC,KAAD;KAAK,QAAQ,cAAc;KAAU,MAAM;KAAG,GAAI,OAAO;eAAzD,CACE,qBAAC,kBAAD;MACG,QACC,YAAY,KAAK,IACf,oBAAC,mBAAD;OACE,SAAS,cAAc,WAAW,UAAU;OAC5C,IAAI,cAAc,YAAY,OAAO,OAAO,OAAO,KAAK;OACxD,MAAM;MACP,KAED,QAEA;MACH,SAAS,QAAQ,cAAc,WAAW,MAAM;MAChD;KACe,MACjB,SAAS,oBAAC,oBAAD,YAAqB,OAA2B,KAAI,IAC3D;;IAGN,qBACC,oBAAC,eAAD;KACa;KACX,cAAW;KACX,MAAK;KACL,SAAS,kBAAkB,CAAC;KAC5B,GAAI,OAAO;IACZ;GAEkB;;CACH;AAE1B,CAAC;AAOD,aAAa,SAAS;AACtB,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,aAAa,QAAQ;AACrB,aAAa,cAAc"}
@@ -1,29 +1,48 @@
1
1
  import { ThemingProps } from "../theme/types.js";
2
2
  import { IconProp, IconProps } from "../icon/icon.types.js";
3
3
  import { BoxProps } from "../box/box.types.js";
4
- import { JSX, ReactNode } from "react";
4
+ import { AriaAttributes, AriaRole, JSX, ReactNode } from "react";
5
5
 
6
6
  //#region src/notification/notification.types.d.ts
7
7
  type NotificationProps = Omit<BoxProps, 'size' | 'variant'> & Omit<ThemingProps<'Notification'>, 'variant'> & {
8
- /** Socket displaying a button on the right. */action?: ReactNode; /** Available theme colors for this component. @deprecated */
8
+ /** Socket displaying a button on the right. */action?: ReactNode; /** Vertical alignment of icon and dismiss button. Use `'center'` for single-line notifications. Manual override for the inferred layout. */
9
+ align?: 'top' | 'center';
10
+ /**
11
+ * ARIA live-region politeness. Auto-mapped from `intent` when omitted:
12
+ * info/success → `'polite'`, warning/danger → `'assertive'`. Forced to `'polite'` when `isLoading` is true.
13
+ */
14
+ ariaLive?: AriaAttributes['aria-live']; /** Available theme colors for this component. @deprecated */
9
15
  colorScheme?: 'blue' | 'green' | 'red' | 'yellow'; /** Socket displaying an icon on the left. Set to `''` to suppress auto-injected icons. @deprecated Icons are now auto-injected based on `intent`. */
10
16
  icon?: IconProp | JSX.Element | ''; /** Semantic colour intent — drives variant colour and auto-injects the matching icon. */
11
- intent?: NotificationIntent; /** When true, shows a loading spinner icon and suppresses intent-based icon injection. */
17
+ intent?: NotificationIntent; /** When true, shows a loading spinner icon and suppresses intent-based icon injection. Forces `role="status"` / `aria-live="polite"` and defaults `intent` to `'info'` when not specified. */
12
18
  isLoading?: boolean; /** Callback function for the dismiss button. Only used when showDismissButton is true. */
13
- onClose?: () => void; /** Controls dismiss button visibility. When true, shows the button. Provide onClose for custom handler or use default. */
19
+ onClose?: () => void;
20
+ /**
21
+ * ARIA role override. Auto-mapped from `intent` when omitted:
22
+ * info/success → `'status'`, warning/danger → `'alert'`. Forced to `'status'` when `isLoading` is true.
23
+ */
24
+ role?: AriaRole; /** Controls dismiss button visibility. When true, shows the button. Provide onClose for custom handler or use default. */
14
25
  showDismissButton?: boolean; /** Modifies Notification style and content based on the given status. @deprecated Use `variant` + `intent` instead. */
15
26
  status?: NotificationStatus; /** Object definition of styles and content for each status. @deprecated Use `variant` + `intent` instead. */
16
27
  statusMapping?: NotificationStatusMapping; /** Socket displaying text in the middle. */
17
28
  text?: ReactNode; /** Socket displaying title in the middle. */
18
29
  title?: ReactNode; /** The notification display style, or a legacy compound variant string. */
19
- variant?: NotificationVariantHierarchy | NotificationVariantLegacy | (string & {}); /** Vertical alignment of icon and dismiss button. Use `'center'` for single-line notifications. */
20
- align?: 'top' | 'center'; /** @deprecated Use `align` instead. `'flex-start'` maps to `'top'`. */
30
+ variant?: NotificationVariantHierarchy | NotificationVariantLegacy | (string & {}); /** @deprecated Use `align` instead. `'flex-start'` maps to `'top'`. */
21
31
  verticalAlign?: 'center' | 'flex-start';
22
32
  };
23
33
  /** Semantic colour intents for the two-prop API. */
24
34
  type NotificationIntent = 'info' | 'success' | 'danger' | 'warning';
25
35
  /** Display style hierarchy for the two-prop API. */
26
36
  type NotificationVariantHierarchy = 'inline' | 'banner';
37
+ /**
38
+ * Inferred layout based on content composition:
39
+ * - `'button-down'` when an `action` socket is present
40
+ * - `'multiline'` when both `title` and `text` are present (and no action)
41
+ * - `'one-line'` otherwise
42
+ *
43
+ * Layout is inference-only — there is no `layout` prop. Use `align` to override visual alignment.
44
+ */
45
+ type NotificationLayout = 'one-line' | 'multiline' | 'button-down';
27
46
  /**
28
47
  * Legacy compound variant strings — kept for backward compatibility.
29
48
  * Prefer `variant` + `intent` instead.
@@ -44,6 +63,6 @@ type NotificationStatusEntry = {
44
63
  };
45
64
  type NotificationStatusMapping = Record<string, NotificationStatusEntry>;
46
65
  //#endregion
47
- export { NotificationIntent, NotificationProps, NotificationStatus, NotificationStatusEntry, NotificationStatusMapping, NotificationVariant, NotificationVariantHierarchy, NotificationVariantLegacy };
66
+ export { NotificationIntent, NotificationLayout, NotificationProps, NotificationStatus, NotificationStatusEntry, NotificationStatusMapping, NotificationVariant, NotificationVariantHierarchy, NotificationVariantLegacy };
48
67
 
49
68
  //# sourceMappingURL=notification.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification.types.d.ts","names":[],"sources":["../../src/notification/notification.types.ts"],"mappings":";;;;;;KAMY,iBAAA,GAAoB,IAAA,CAAK,QAAA,wBACnC,IAAA,CAAK,YAAA;iDAEH,MAAA,GAAS,SAAA;EAET,WAAA,wCALQ;EAOR,IAAA,GAAO,QAAA,GAAW,GAAA,CAAI,OAAA;EAEtB,MAAA,GAAS,kBAAA,EATmB;EAW5B,SAAA,YAVF;EAYE,OAAA,eANO;EAQP,iBAAA,YANS;EAQT,MAAA,GAAS,kBAAA,EAEO;EAAhB,aAAA,GAAgB,yBAAA,EAIR;EAFR,IAAA,GAAO,SAAA,EAIkC;EAFzC,KAAA,GAAQ,SAAA,EAE0D;EAAlE,OAAA,GAAU,4BAAA,GAA+B,yBAAA,kBAzBR;EA2BjC,KAAA,qBA1BG;EA4BH,aAAA;AAAA;;KAIQ,kBAAA;;KAGA,4BAAA;;;;;;KAOA,yBAAA;;;;;KAcA,mBAAA,GAAsB,4BAAA,GAA+B,yBAAyB;AAAA,KAE9E,kBAAA;AAAA,KAYA,uBAAA;EACV,SAAA,EAAW,SAAA;EACX,MAAA,GAAS,kBAAA;EACT,SAAA;EACA,OAAA,GAAU,4BAAA,GAA+B,yBAAA;AAAA;AAAA,KAG/B,yBAAA,GAA4B,MAAM,SAAS,uBAAA"}
1
+ {"version":3,"file":"notification.types.d.ts","names":[],"sources":["../../src/notification/notification.types.ts"],"mappings":";;;;;;KAMY,iBAAA,GAAoB,IAAA,CAAK,QAAA,wBACnC,IAAA,CAAK,YAAA;iDAEH,MAAA,GAAS,SAAA;EAET,KAAA;EALQ;;;;EAUR,QAAA,GAAW,cAAA,eATR;EAWH,WAAA,wCATS;EAWT,IAAA,GAAO,QAAA,GAAW,GAAA,CAAI,OAAA,OAAf;EAEP,MAAA,GAAS,kBAAA,EAAA;EAET,SAAA,YAWS;EATT,OAAA;EAaO;;;;EARP,IAAA,GAAO,QAAA,EAY2D;EAVlE,iBAAA,YA3BiC;EA6BjC,MAAA,GAAS,kBAAA,EA5BN;EA8BH,aAAA,GAAgB,yBAAA,EA5BP;EA8BT,IAAA,GAAO,SAAA,EAvBP;EAyBA,KAAA,GAAQ,SAAA,EAvBR;EAyBA,OAAA,GAAU,4BAAA,GAA+B,yBAAA,kBAvBlC;EAyBP,aAAA;AAAA;;KAIQ,kBAAA;;KAGA,4BAAA;;;;;;;;;KAUA,kBAAA;;;;;;KAOA,yBAAA;;AAxBK;AAIjB;;KAkCY,mBAAA,GAAsB,4BAAA,GAA+B,yBAAyB;AAAA,KAE9E,kBAAA;AAAA,KAYA,uBAAA;EACV,SAAA,EAAW,SAAA;EACX,MAAA,GAAS,kBAAA;EACT,SAAA;EACA,OAAA,GAAU,4BAAA,GAA+B,yBAAA;AAAA;AAAA,KAG/B,yBAAA,GAA4B,MAAM,SAAS,uBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"notificationAction.d.ts","names":[],"sources":["../../src/notification/notificationAction.tsx"],"mappings":";;;;cAOa,kBAAA,EAAkB,YAAA,QAAA,QAAA"}
1
+ {"version":3,"file":"notificationAction.d.ts","names":[],"sources":["../../src/notification/notificationAction.tsx"],"mappings":";;;;cAQa,kBAAA,EAAkB,YAAA,QAAA,QAAA"}
@@ -9,10 +9,15 @@ import { jsx } from "react/jsx-runtime";
9
9
  /** Displays an action button within the Notification. */
10
10
  const NotificationAction = vui((props, ref) => {
11
11
  const { children, className, ...rest } = props;
12
- const styles = useStyleConfig("Notification", useNotificationContext());
12
+ const ctx = useNotificationContext();
13
+ const styles = useStyleConfig("Notification", ctx);
14
+ const layout = ctx?.layout;
15
+ const isButtonDown = layout === "button-down";
13
16
  return /* @__PURE__ */ jsx(Box, {
14
17
  className: cs("vui-notificationAction", className),
15
18
  ref,
19
+ "data-layout": layout,
20
+ w: isButtonDown ? "100%" : void 0,
16
21
  ...styles.actionBox,
17
22
  ...rest,
18
23
  children
@@ -1 +1 @@
1
- {"version":3,"file":"notificationAction.js","names":[],"sources":["../../src/notification/notificationAction.tsx"],"sourcesContent":["import Box from '../box'\nimport type { BoxProps } from '../box'\nimport { useStyleConfig, vui } from '../core'\nimport { cs } from '../utils'\nimport { useNotificationContext } from './context'\n\n/** Displays an action button within the Notification. */\nexport const NotificationAction = vui<'div', BoxProps>((props, ref) => {\n const { children, className, ...rest } = props\n const styles = useStyleConfig('Notification', useNotificationContext())\n\n return (\n <Box className={cs('vui-notificationAction', className)} ref={ref} {...styles.actionBox} {...rest}>\n {children}\n </Box>\n )\n})\n\nNotificationAction.displayName = 'NotificationAction'\nexport default NotificationAction\n"],"mappings":";;;;;;;;;AAOA,MAAa,qBAAqB,KAAsB,OAAO,QAAQ;CACrE,MAAM,EAAE,UAAU,WAAW,GAAG,SAAS;CACzC,MAAM,SAAS,eAAe,gBAAgB,uBAAuB,CAAC;CAEtE,OACE,oBAAC,KAAD;EAAK,WAAW,GAAG,0BAA0B,SAAS;EAAQ;EAAK,GAAI,OAAO;EAAW,GAAI;EAC1F;CACE;AAET,CAAC;AAED,mBAAmB,cAAc"}
1
+ {"version":3,"file":"notificationAction.js","names":[],"sources":["../../src/notification/notificationAction.tsx"],"sourcesContent":["import Box from '../box'\nimport type { BoxProps } from '../box'\nimport { useStyleConfig, vui } from '../core'\nimport { cs } from '../utils'\nimport { useNotificationContext } from './context'\nimport type { NotificationLayout } from './notification.types'\n\n/** Displays an action button within the Notification. */\nexport const NotificationAction = vui<'div', BoxProps>((props, ref) => {\n const { children, className, ...rest } = props\n const ctx = useNotificationContext()\n const styles = useStyleConfig('Notification', ctx)\n\n // Q10: When rendered inside a button-down layout, the action region stretches\n // full-width and exposes `data-layout` so consumers (and the SCSS reference)\n // can scope styles to the button-down CTA without coupling to Button internals.\n // TODO(763859 follow-up): inject intent-colored Button variant when the child\n // is a VUI Button without an explicit `variant` prop.\n const layout = (ctx as { layout?: NotificationLayout })?.layout\n const isButtonDown = layout === 'button-down'\n\n return (\n <Box\n className={cs('vui-notificationAction', className)}\n ref={ref}\n data-layout={layout}\n w={isButtonDown ? '100%' : undefined}\n {...styles.actionBox}\n {...rest}\n >\n {children}\n </Box>\n )\n})\n\nNotificationAction.displayName = 'NotificationAction'\nexport default NotificationAction\n"],"mappings":";;;;;;;;;AAQA,MAAa,qBAAqB,KAAsB,OAAO,QAAQ;CACrE,MAAM,EAAE,UAAU,WAAW,GAAG,SAAS;CACzC,MAAM,MAAM,uBAAuB;CACnC,MAAM,SAAS,eAAe,gBAAgB,GAAG;CAOjD,MAAM,SAAU,KAAyC;CACzD,MAAM,eAAe,WAAW;CAEhC,OACE,oBAAC,KAAD;EACE,WAAW,GAAG,0BAA0B,SAAS;EAC5C;EACL,eAAa;EACb,GAAG,eAAe,SAAS;EAC3B,GAAI,OAAO;EACX,GAAI;EAEH;CACE;AAET,CAAC;AAED,mBAAmB,cAAc"}
@@ -19,16 +19,25 @@ const intentTokens = {
19
19
  success: {
20
20
  feedbackSubtle: "var(--vui-feedback-success-subtle)",
21
21
  feedbackSolid: "var(--vui-feedback-success-solid)",
22
- dismissColor: "var(--vui-action-success-subtle-inverse)"
22
+ dismissColor: "var(--vui-feedback-success-solid)"
23
23
  }
24
24
  };
25
25
  /** Variant styles per visual hierarchy, composed from intent tokens. */
26
- const hierarchyRules = { inline: (t) => ({ container: {
27
- bg: t.feedbackSubtle,
28
- borderColor: t.feedbackSolid,
29
- color: t.feedbackSolid,
30
- "--vui-dismiss-fg": t.dismissColor
31
- } }) };
26
+ const hierarchyRules = {
27
+ inline: (t) => ({ container: {
28
+ bg: t.feedbackSubtle,
29
+ borderColor: t.feedbackSolid,
30
+ color: t.feedbackSolid,
31
+ "--vui-dismiss-fg": t.dismissColor
32
+ } }),
33
+ banner: (t) => ({ container: {
34
+ bg: t.feedbackSubtle,
35
+ borderColor: t.feedbackSolid,
36
+ color: t.feedbackSolid,
37
+ "--vui-dismiss-fg": t.dismissColor,
38
+ "--vui-notification-border-width": "0"
39
+ } })
40
+ };
32
41
  const baseStyle = {
33
42
  container: {
34
43
  borderRadius: "var(--vui-notification-border-radius, 0)",
@@ -45,10 +54,12 @@ const baseStyle = {
45
54
  icon: { py: "var(--vui-notification-content-padding-y, 8px)" },
46
55
  text: {
47
56
  flex: "1",
48
- lineHeight: "var(--vui-notification-text-line-height, 24px)",
57
+ fontSize: "16px",
58
+ lineHeight: "150%",
59
+ fontWeight: 400,
49
60
  minW: 0
50
61
  },
51
- title: { mb: "var(--vui-notification-title-margin-bottom, 4px)" },
62
+ title: { mb: "4px" },
52
63
  actionBox: { mt: "var(--vui-notification-action-margin-top, 12px)" }
53
64
  };
54
65
  const parts = [
@@ -67,7 +78,11 @@ const variants = {
67
78
  subtleBlue: generatedVariants.inlineInfo,
68
79
  subtleRed: generatedVariants.inlineDanger,
69
80
  subtleYellow: generatedVariants.inlineWarning,
70
- subtleGreen: generatedVariants.inlineSuccess
81
+ subtleGreen: generatedVariants.inlineSuccess,
82
+ bannerBlue: generatedVariants.bannerInfo,
83
+ bannerRed: generatedVariants.bannerDanger,
84
+ bannerYellow: generatedVariants.bannerWarning,
85
+ bannerGreen: generatedVariants.bannerSuccess
71
86
  };
72
87
  var theme_default = {
73
88
  baseStyle,
@@ -1 +1 @@
1
- {"version":3,"file":"theme.js","names":[],"sources":["../../src/notification/theme.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// Generated variant approach — mirrors button/theme.ts\n//\n// Each intent defines its token references once.\n// Each hierarchy rule composes container/button styles from those tokens.\n// Canonical variants are produced via Object.fromEntries — no hand-written\n// duplication; adding a new intent or hierarchy is a 1-line change.\n// ---------------------------------------------------------------------------\n\ninterface IntentTokens {\n feedbackSubtle: string // container background\n feedbackSolid: string // container border + text color\n dismissColor: string // dismiss button color (usually feedbackSolid; exception: success)\n}\n\n/** Token references per semantic intent. */\nconst intentTokens: Record<string, IntentTokens> = {\n info: {\n feedbackSubtle: 'var(--vui-feedback-info-subtle)',\n feedbackSolid: 'var(--vui-feedback-info-solid)',\n dismissColor: 'var(--vui-feedback-info-solid)',\n },\n danger: {\n feedbackSubtle: 'var(--vui-feedback-danger-subtle)',\n feedbackSolid: 'var(--vui-feedback-danger-solid)',\n dismissColor: 'var(--vui-feedback-danger-solid)',\n },\n warning: {\n feedbackSubtle: 'var(--vui-feedback-warning-subtle)',\n feedbackSolid: 'var(--vui-feedback-warning-solid)',\n dismissColor: 'var(--vui-feedback-warning-solid)',\n },\n success: {\n feedbackSubtle: 'var(--vui-feedback-success-subtle)',\n feedbackSolid: 'var(--vui-feedback-success-solid)',\n // success uses subtle-inverse for the dismiss button (design exception)\n dismissColor: 'var(--vui-action-success-subtle-inverse)',\n },\n}\n\n/** Variant styles per visual hierarchy, composed from intent tokens. */\nconst hierarchyRules: Record<string, (t: IntentTokens) => object> = {\n inline: t => ({\n container: {\n bg: t.feedbackSubtle,\n borderColor: t.feedbackSolid,\n color: t.feedbackSolid,\n '--vui-dismiss-fg': t.dismissColor,\n },\n }),\n}\n\n// ---------------------------------------------------------------------------\n\nconst baseStyle = {\n container: {\n borderRadius: 'var(--vui-notification-border-radius, 0)',\n borderWidth: 'var(--vui-notification-border-width, 1px)',\n bg: 'var(--vui-feedback-neutral-subtle)',\n borderColor: 'var(--vui-feedback-neutral-solid)',\n color: 'var(--vui-feedback-neutral-solid)',\n // Figma: container px:16, py:8, gap:16 between icon | content | dismiss\n px: 'var(--vui-notification-padding-x, 16px)',\n py: 'var(--vui-notification-padding-y, 8px)',\n gap: 'var(--vui-notification-gap, 16px)',\n },\n // Figma: icon and content each get py:8 so total vertical space = 8+8 = 16px from border\n content: {\n py: 'var(--vui-notification-content-padding-y, 8px)',\n },\n button: {},\n icon: {\n py: 'var(--vui-notification-content-padding-y, 8px)',\n },\n text: {\n flex: '1',\n lineHeight: 'var(--vui-notification-text-line-height, 24px)',\n minW: 0,\n },\n title: {\n mb: 'var(--vui-notification-title-margin-bottom, 4px)',\n },\n // Figma: gap from text to action is 12px; outer spacing handled by container\n actionBox: {\n mt: 'var(--vui-notification-action-margin-top, 12px)',\n },\n}\n\nconst parts = ['container', 'content', 'button', 'icon', 'text', 'title', 'actionBox']\n\nconst sizes = {}\n\n// Generated: inlineInfo, inlineDanger, inlineWarning, inlineSuccess\n// Legacy aliases: subtleBlue, subtleRed, subtleYellow, subtleGreen kept for backward compatibility\nconst generatedVariants = Object.fromEntries(\n Object.entries(intentTokens).flatMap(([intentKey, tokens]) =>\n Object.entries(hierarchyRules).map(([hierarchyKey, buildVariant]) => [\n `${hierarchyKey}${intentKey.charAt(0).toUpperCase()}${intentKey.slice(1)}`,\n buildVariant(tokens),\n ]),\n ),\n)\n\nconst variants = {\n ...generatedVariants,\n // Legacy aliases — kept for backward compatibility\n subtleBlue: generatedVariants.inlineInfo,\n subtleRed: generatedVariants.inlineDanger,\n subtleYellow: generatedVariants.inlineWarning,\n subtleGreen: generatedVariants.inlineSuccess,\n}\n\nexport default {\n baseStyle,\n parts,\n sizes,\n variants,\n}\n"],"mappings":";;AAgBA,MAAM,eAA6C;CACjD,MAAM;EACJ,gBAAgB;EAChB,eAAe;EACf,cAAc;CAChB;CACA,QAAQ;EACN,gBAAgB;EAChB,eAAe;EACf,cAAc;CAChB;CACA,SAAS;EACP,gBAAgB;EAChB,eAAe;EACf,cAAc;CAChB;CACA,SAAS;EACP,gBAAgB;EAChB,eAAe;EAEf,cAAc;CAChB;AACF;;AAGA,MAAM,iBAA8D,EAClE,SAAQ,OAAM,EACZ,WAAW;CACT,IAAI,EAAE;CACN,aAAa,EAAE;CACf,OAAO,EAAE;CACT,oBAAoB,EAAE;AACxB,EACF,GACF;AAIA,MAAM,YAAY;CAChB,WAAW;EACT,cAAc;EACd,aAAa;EACb,IAAI;EACJ,aAAa;EACb,OAAO;EAEP,IAAI;EACJ,IAAI;EACJ,KAAK;CACP;CAEA,SAAS,EACP,IAAI,iDACN;CACA,QAAQ,CAAC;CACT,MAAM,EACJ,IAAI,iDACN;CACA,MAAM;EACJ,MAAM;EACN,YAAY;EACZ,MAAM;CACR;CACA,OAAO,EACL,IAAI,mDACN;CAEA,WAAW,EACT,IAAI,kDACN;AACF;AAEA,MAAM,QAAQ;CAAC;CAAa;CAAW;CAAU;CAAQ;CAAQ;CAAS;AAAW;AAErF,MAAM,QAAQ,CAAC;AAIf,MAAM,oBAAoB,OAAO,YAC/B,OAAO,QAAQ,YAAY,CAAC,CAAC,SAAS,CAAC,WAAW,YAChD,OAAO,QAAQ,cAAc,CAAC,CAAC,KAAK,CAAC,cAAc,kBAAkB,CACnE,GAAG,eAAe,UAAU,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,UAAU,MAAM,CAAC,KACvE,aAAa,MAAM,CACrB,CAAC,CACH,CACF;AAEA,MAAM,WAAW;CACf,GAAG;CAEH,YAAY,kBAAkB;CAC9B,WAAW,kBAAkB;CAC7B,cAAc,kBAAkB;CAChC,aAAa,kBAAkB;AACjC;AAEA,oBAAe;CACb;CACA;CACA;CACA;AACF"}
1
+ {"version":3,"file":"theme.js","names":[],"sources":["../../src/notification/theme.ts"],"sourcesContent":["// ---------------------------------------------------------------------------\n// Generated variant approach — mirrors button/theme.ts\n//\n// Each intent defines its token references once.\n// Each hierarchy rule composes container/button styles from those tokens.\n// Canonical variants are produced via Object.fromEntries — no hand-written\n// duplication; adding a new intent or hierarchy is a 1-line change.\n// ---------------------------------------------------------------------------\n\ninterface IntentTokens {\n feedbackSubtle: string // container background\n feedbackSolid: string // container border + text color\n dismissColor: string // dismiss button color (= feedbackSolid for all intents; Q8 removed the success exception)\n}\n\n/** Token references per semantic intent. */\nconst intentTokens: Record<string, IntentTokens> = {\n info: {\n feedbackSubtle: 'var(--vui-feedback-info-subtle)',\n feedbackSolid: 'var(--vui-feedback-info-solid)',\n dismissColor: 'var(--vui-feedback-info-solid)',\n },\n danger: {\n feedbackSubtle: 'var(--vui-feedback-danger-subtle)',\n feedbackSolid: 'var(--vui-feedback-danger-solid)',\n dismissColor: 'var(--vui-feedback-danger-solid)',\n },\n warning: {\n feedbackSubtle: 'var(--vui-feedback-warning-subtle)',\n feedbackSolid: 'var(--vui-feedback-warning-solid)',\n dismissColor: 'var(--vui-feedback-warning-solid)',\n },\n success: {\n feedbackSubtle: 'var(--vui-feedback-success-subtle)',\n feedbackSolid: 'var(--vui-feedback-success-solid)',\n // Q8: success now uses feedbackSolid like other intents (no exception).\n dismissColor: 'var(--vui-feedback-success-solid)',\n },\n}\n\n/** Variant styles per visual hierarchy, composed from intent tokens. */\nconst hierarchyRules: Record<string, (t: IntentTokens) => object> = {\n inline: t => ({\n container: {\n bg: t.feedbackSubtle,\n borderColor: t.feedbackSolid,\n color: t.feedbackSolid,\n '--vui-dismiss-fg': t.dismissColor,\n },\n }),\n // Q5: banner drops border by setting border-width to 0; same colors as inline.\n banner: t => ({\n container: {\n bg: t.feedbackSubtle,\n borderColor: t.feedbackSolid,\n color: t.feedbackSolid,\n '--vui-dismiss-fg': t.dismissColor,\n '--vui-notification-border-width': '0',\n },\n }),\n}\n\n// ---------------------------------------------------------------------------\n\nconst baseStyle = {\n container: {\n borderRadius: 'var(--vui-notification-border-radius, 0)',\n borderWidth: 'var(--vui-notification-border-width, 1px)',\n bg: 'var(--vui-feedback-neutral-subtle)',\n borderColor: 'var(--vui-feedback-neutral-solid)',\n color: 'var(--vui-feedback-neutral-solid)',\n // Figma: container px:16, py:8, gap:16 between icon | content | dismiss\n px: 'var(--vui-notification-padding-x, 16px)',\n py: 'var(--vui-notification-padding-y, 8px)',\n gap: 'var(--vui-notification-gap, 16px)',\n },\n // Figma: icon and content each get py:8 so total vertical space = 8+8 = 16px from border\n content: {\n py: 'var(--vui-notification-content-padding-y, 8px)',\n },\n button: {},\n icon: {\n py: 'var(--vui-notification-content-padding-y, 8px)',\n },\n text: {\n flex: '1',\n fontSize: '16px',\n lineHeight: '150%',\n fontWeight: 400,\n minW: 0,\n },\n title: {\n mb: '4px',\n },\n // Figma: gap from text to action is 12px; outer spacing handled by container\n actionBox: {\n mt: 'var(--vui-notification-action-margin-top, 12px)',\n },\n}\n\nconst parts = ['container', 'content', 'button', 'icon', 'text', 'title', 'actionBox']\n\nconst sizes = {}\n\n// Generated: inlineInfo, inlineDanger, inlineWarning, inlineSuccess,\n// bannerInfo, bannerDanger, bannerWarning, bannerSuccess\n// Legacy aliases below preserve backward compatibility for the old single-key API.\nconst generatedVariants = Object.fromEntries(\n Object.entries(intentTokens).flatMap(([intentKey, tokens]) =>\n Object.entries(hierarchyRules).map(([hierarchyKey, buildVariant]) => [\n `${hierarchyKey}${intentKey.charAt(0).toUpperCase()}${intentKey.slice(1)}`,\n buildVariant(tokens),\n ]),\n ),\n)\n\nconst variants = {\n ...generatedVariants,\n // Legacy aliases — kept for backward compatibility\n subtleBlue: generatedVariants.inlineInfo,\n subtleRed: generatedVariants.inlineDanger,\n subtleYellow: generatedVariants.inlineWarning,\n subtleGreen: generatedVariants.inlineSuccess,\n bannerBlue: generatedVariants.bannerInfo,\n bannerRed: generatedVariants.bannerDanger,\n bannerYellow: generatedVariants.bannerWarning,\n bannerGreen: generatedVariants.bannerSuccess,\n}\n\nexport default {\n baseStyle,\n parts,\n sizes,\n variants,\n}\n"],"mappings":";;AAgBA,MAAM,eAA6C;CACjD,MAAM;EACJ,gBAAgB;EAChB,eAAe;EACf,cAAc;CAChB;CACA,QAAQ;EACN,gBAAgB;EAChB,eAAe;EACf,cAAc;CAChB;CACA,SAAS;EACP,gBAAgB;EAChB,eAAe;EACf,cAAc;CAChB;CACA,SAAS;EACP,gBAAgB;EAChB,eAAe;EAEf,cAAc;CAChB;AACF;;AAGA,MAAM,iBAA8D;CAClE,SAAQ,OAAM,EACZ,WAAW;EACT,IAAI,EAAE;EACN,aAAa,EAAE;EACf,OAAO,EAAE;EACT,oBAAoB,EAAE;CACxB,EACF;CAEA,SAAQ,OAAM,EACZ,WAAW;EACT,IAAI,EAAE;EACN,aAAa,EAAE;EACf,OAAO,EAAE;EACT,oBAAoB,EAAE;EACtB,mCAAmC;CACrC,EACF;AACF;AAIA,MAAM,YAAY;CAChB,WAAW;EACT,cAAc;EACd,aAAa;EACb,IAAI;EACJ,aAAa;EACb,OAAO;EAEP,IAAI;EACJ,IAAI;EACJ,KAAK;CACP;CAEA,SAAS,EACP,IAAI,iDACN;CACA,QAAQ,CAAC;CACT,MAAM,EACJ,IAAI,iDACN;CACA,MAAM;EACJ,MAAM;EACN,UAAU;EACV,YAAY;EACZ,YAAY;EACZ,MAAM;CACR;CACA,OAAO,EACL,IAAI,MACN;CAEA,WAAW,EACT,IAAI,kDACN;AACF;AAEA,MAAM,QAAQ;CAAC;CAAa;CAAW;CAAU;CAAQ;CAAQ;CAAS;AAAW;AAErF,MAAM,QAAQ,CAAC;AAKf,MAAM,oBAAoB,OAAO,YAC/B,OAAO,QAAQ,YAAY,CAAC,CAAC,SAAS,CAAC,WAAW,YAChD,OAAO,QAAQ,cAAc,CAAC,CAAC,KAAK,CAAC,cAAc,kBAAkB,CACnE,GAAG,eAAe,UAAU,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,UAAU,MAAM,CAAC,KACvE,aAAa,MAAM,CACrB,CAAC,CACH,CACF;AAEA,MAAM,WAAW;CACf,GAAG;CAEH,YAAY,kBAAkB;CAC9B,WAAW,kBAAkB;CAC7B,cAAc,kBAAkB;CAChC,aAAa,kBAAkB;CAC/B,YAAY,kBAAkB;CAC9B,WAAW,kBAAkB;CAC7B,cAAc,kBAAkB;CAChC,aAAa,kBAAkB;AACjC;AAEA,oBAAe;CACb;CACA;CACA;CACA;AACF"}
@@ -1,9 +1,8 @@
1
1
  //#region src/notification/utils.ts
2
2
  /** Canonical hierarchy keys recognised by the two-prop API. */
3
3
  const HIERARCHY_KEYS = new Set(["inline", "banner"]);
4
- /** The banner hierarchy key — banner variants map to inline for theme lookup but carry extra overrides. */
4
+ /** The banner hierarchy key. */
5
5
  const BANNER_HIERARCHY = "banner";
6
- const INLINE_HIERARCHY = "inline";
7
6
  /** Default intent applied when none is specified. */
8
7
  const DEFAULT_INTENT = "info";
9
8
  /** Default variant hierarchy applied when none is specified. */
@@ -14,25 +13,55 @@ const DEFAULT_VARIANT = "inline";
14
13
  */
15
14
  const capitalize = (s) => s.charAt(0).toUpperCase() + s.slice(1);
16
15
  /**
17
- * Converts a two-prop variant+intent pair into the combined theme key used
18
- * internally (e.g. `resolveNotificationVariant('inline', 'info') => { themeKey: 'inlineInfo', isBanner: false }`).
16
+ * Converts a two-prop variant+intent pair into the combined theme key used internally
17
+ * (e.g. `resolveNotificationVariant('inline', 'info') => { themeKey: 'inlineInfo', isBanner: false }`).
19
18
  * When `intent` is omitted, `DEFAULT_INTENT` ('info') is used.
20
19
  *
21
- * If `variant` is already a fully-qualified legacy key (e.g. `'inlineBlue'`)
20
+ * If `variant` is already a fully-qualified legacy key (e.g. `'inlineBlue'`, `'bannerRed'`)
22
21
  * it is returned unchanged so the new API is backward-compatible.
23
22
  *
24
23
  * Returns `{ themeKey: 'inlineInfo', isBanner: false }` (the default) when `variant` is absent.
25
24
  */
26
25
  const resolveNotificationVariant = (variant = DEFAULT_VARIANT, intent = DEFAULT_INTENT) => {
27
- const resolved = !variant ? `${DEFAULT_VARIANT}${capitalize(DEFAULT_INTENT)}` : !HIERARCHY_KEYS.has(variant) ? variant : `${variant}${capitalize(intent)}`;
28
- const isBanner = resolved.startsWith(BANNER_HIERARCHY);
26
+ const themeKey = !variant ? `${DEFAULT_VARIANT}${capitalize(DEFAULT_INTENT)}` : !HIERARCHY_KEYS.has(variant) ? variant : `${variant}${capitalize(intent)}`;
29
27
  return {
30
- themeKey: isBanner ? resolved.replace(BANNER_HIERARCHY, INLINE_HIERARCHY) : resolved,
31
- isBanner
28
+ themeKey,
29
+ isBanner: themeKey.startsWith(BANNER_HIERARCHY)
30
+ };
31
+ };
32
+ /**
33
+ * Q2 — Infers the layout from content composition. No `layout` prop exists; this
34
+ * is the single source of truth for visual layout.
35
+ *
36
+ * - `action` present → `'button-down'`
37
+ * - both `title` and `text` present → `'multiline'`
38
+ * - otherwise → `'one-line'`
39
+ */
40
+ const inferNotificationLayout = (args) => {
41
+ if (args.hasStatus) return "one-line";
42
+ if (args.action != null && args.action !== false && args.action !== "") return "button-down";
43
+ if (args.title != null && args.title !== "" && args.text != null && args.text !== "") return "multiline";
44
+ return "one-line";
45
+ };
46
+ /**
47
+ * Q4 — Auto-maps intent to the appropriate ARIA role / aria-live politeness.
48
+ * `isLoading` forces `role="status"` / `aria-live="polite"` regardless of intent.
49
+ */
50
+ const resolveNotificationAria = (args) => {
51
+ if (args.isLoading) return {
52
+ role: "status",
53
+ ariaLive: "polite"
54
+ };
55
+ return args.intent === "warning" || args.intent === "danger" ? {
56
+ role: "alert",
57
+ ariaLive: "assertive"
58
+ } : {
59
+ role: "status",
60
+ ariaLive: "polite"
32
61
  };
33
62
  };
34
63
 
35
64
  //#endregion
36
- export { DEFAULT_VARIANT, resolveNotificationVariant };
65
+ export { DEFAULT_VARIANT, inferNotificationLayout, resolveNotificationAria, resolveNotificationVariant };
37
66
  globalThis.__vuiVersion__ = "5.2.0"
38
67
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":[],"sources":["../../src/notification/utils.ts"],"sourcesContent":["/**\n * Notification utilities — pure functions shared by consts.ts and notification.tsx.\n * Kept separate to avoid circular imports.\n */\n\nimport type { NotificationIntent, NotificationVariantHierarchy, NotificationVariantLegacy } from './notification.types'\n\n/** Canonical hierarchy keys recognised by the two-prop API. */\nconst HIERARCHY_KEYS = new Set<string>(['inline', 'banner'])\n\n/** The banner hierarchy key — banner variants map to inline for theme lookup but carry extra overrides. */\nconst BANNER_HIERARCHY = 'banner'\nconst INLINE_HIERARCHY = 'inline'\n\n/** Default intent applied when none is specified. */\nexport const DEFAULT_INTENT: NotificationIntent = 'info'\n\n/** Default variant hierarchy applied when none is specified. */\nexport const DEFAULT_VARIANT: NotificationVariantHierarchy = 'inline'\n\n/**\n * Capitalises the first character of a string.\n * Mirrors button/utils.ts — used to compose theme keys the same way theme.ts generates them.\n */\nconst capitalize = (s: string) => s.charAt(0).toUpperCase() + s.slice(1)\n\nexport interface ResolvedNotificationVariant {\n /** The theme key to pass to useStyleConfig (banner variants map to their inline counterpart). */\n themeKey: string\n /** True when the resolved variant is a banner hierarchy — component uses this to add elevation + border overrides. */\n isBanner: boolean\n}\n\n/**\n * Converts a two-prop variant+intent pair into the combined theme key used\n * internally (e.g. `resolveNotificationVariant('inline', 'info') => { themeKey: 'inlineInfo', isBanner: false }`).\n * When `intent` is omitted, `DEFAULT_INTENT` ('info') is used.\n *\n * If `variant` is already a fully-qualified legacy key (e.g. `'inlineBlue'`)\n * it is returned unchanged so the new API is backward-compatible.\n *\n * Returns `{ themeKey: 'inlineInfo', isBanner: false }` (the default) when `variant` is absent.\n */\nexport const resolveNotificationVariant = (\n variant: NotificationVariantHierarchy | NotificationVariantLegacy | string | undefined = DEFAULT_VARIANT,\n intent: NotificationIntent | string | undefined = DEFAULT_INTENT,\n): ResolvedNotificationVariant => {\n const resolved = !variant\n ? `${DEFAULT_VARIANT}${capitalize(DEFAULT_INTENT)}`\n : !HIERARCHY_KEYS.has(variant)\n ? variant // Already a combined legacy key — pass through unchanged\n : `${variant}${capitalize(intent)}` // New two-prop API\n\n const isBanner = resolved.startsWith(BANNER_HIERARCHY)\n const themeKey = isBanner ? resolved.replace(BANNER_HIERARCHY, INLINE_HIERARCHY) : resolved\n\n return { themeKey, isBanner }\n}\n"],"mappings":";;AAQA,MAAM,iBAAiB,IAAI,IAAY,CAAC,UAAU,QAAQ,CAAC;;AAG3D,MAAM,mBAAmB;AACzB,MAAM,mBAAmB;;AAGzB,MAAa,iBAAqC;;AAGlD,MAAa,kBAAgD;;;;;AAM7D,MAAM,cAAc,MAAc,EAAE,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,EAAE,MAAM,CAAC;;;;;;;;;;;AAmBvE,MAAa,8BACX,UAAyF,iBACzF,SAAkD,mBAClB;CAChC,MAAM,WAAW,CAAC,UACd,GAAG,kBAAkB,WAAW,cAAc,MAC9C,CAAC,eAAe,IAAI,OAAO,IACzB,UACA,GAAG,UAAU,WAAW,MAAM;CAEpC,MAAM,WAAW,SAAS,WAAW,gBAAgB;CAGrD,OAAO;EAAE,UAFQ,WAAW,SAAS,QAAQ,kBAAkB,gBAAgB,IAAI;EAEhE;CAAS;AAC9B"}
1
+ {"version":3,"file":"utils.js","names":[],"sources":["../../src/notification/utils.ts"],"sourcesContent":["/**\n * Notification utilities — pure functions shared by consts.ts and notification.tsx.\n * Kept separate to avoid circular imports.\n */\n\nimport type {\n NotificationIntent,\n NotificationLayout,\n NotificationVariantHierarchy,\n NotificationVariantLegacy,\n} from './notification.types'\n\n/** Canonical hierarchy keys recognised by the two-prop API. */\nconst HIERARCHY_KEYS = new Set<string>(['inline', 'banner'])\n\n/** The banner hierarchy key. */\nconst BANNER_HIERARCHY = 'banner'\n\n/** Default intent applied when none is specified. */\nexport const DEFAULT_INTENT: NotificationIntent = 'info'\n\n/** Default variant hierarchy applied when none is specified. */\nexport const DEFAULT_VARIANT: NotificationVariantHierarchy = 'inline'\n\n/**\n * Capitalises the first character of a string.\n * Mirrors button/utils.ts — used to compose theme keys the same way theme.ts generates them.\n */\nconst capitalize = (s: string) => s.charAt(0).toUpperCase() + s.slice(1)\n\nexport interface ResolvedNotificationVariant {\n /** The theme key to pass to useStyleConfig (e.g. `'inlineInfo'`, `'bannerDanger'`). */\n themeKey: string\n /** True when the resolved variant is a banner hierarchy. */\n isBanner: boolean\n}\n\n/**\n * Converts a two-prop variant+intent pair into the combined theme key used internally\n * (e.g. `resolveNotificationVariant('inline', 'info') => { themeKey: 'inlineInfo', isBanner: false }`).\n * When `intent` is omitted, `DEFAULT_INTENT` ('info') is used.\n *\n * If `variant` is already a fully-qualified legacy key (e.g. `'inlineBlue'`, `'bannerRed'`)\n * it is returned unchanged so the new API is backward-compatible.\n *\n * Returns `{ themeKey: 'inlineInfo', isBanner: false }` (the default) when `variant` is absent.\n */\nexport const resolveNotificationVariant = (\n variant: NotificationVariantHierarchy | NotificationVariantLegacy | string | undefined = DEFAULT_VARIANT,\n intent: NotificationIntent | string | undefined = DEFAULT_INTENT,\n): ResolvedNotificationVariant => {\n const themeKey = !variant\n ? `${DEFAULT_VARIANT}${capitalize(DEFAULT_INTENT)}`\n : !HIERARCHY_KEYS.has(variant)\n ? variant // Already a combined legacy key — pass through unchanged\n : `${variant}${capitalize(intent)}` // New two-prop API\n\n const isBanner = themeKey.startsWith(BANNER_HIERARCHY)\n\n return { themeKey, isBanner }\n}\n\n/**\n * Q2 — Infers the layout from content composition. No `layout` prop exists; this\n * is the single source of truth for visual layout.\n *\n * - `action` present → `'button-down'`\n * - both `title` and `text` present → `'multiline'`\n * - otherwise → `'one-line'`\n */\nexport const inferNotificationLayout = (args: {\n action?: unknown\n text?: unknown\n title?: unknown\n hasStatus?: boolean\n}): NotificationLayout => {\n if (args.hasStatus) return 'one-line'\n if (args.action != null && args.action !== false && args.action !== '') return 'button-down'\n if (args.title != null && args.title !== '' && args.text != null && args.text !== '') return 'multiline'\n return 'one-line'\n}\n\n/**\n * Q4 — Auto-maps intent to the appropriate ARIA role / aria-live politeness.\n * `isLoading` forces `role=\"status\"` / `aria-live=\"polite\"` regardless of intent.\n */\nexport const resolveNotificationAria = (args: {\n intent?: NotificationIntent\n isLoading?: boolean\n}): { role: 'status' | 'alert'; ariaLive: 'polite' | 'assertive' } => {\n if (args.isLoading) return { role: 'status', ariaLive: 'polite' }\n const isUrgent = args.intent === 'warning' || args.intent === 'danger'\n return isUrgent ? { role: 'alert', ariaLive: 'assertive' } : { role: 'status', ariaLive: 'polite' }\n}\n"],"mappings":";;AAaA,MAAM,iBAAiB,IAAI,IAAY,CAAC,UAAU,QAAQ,CAAC;;AAG3D,MAAM,mBAAmB;;AAGzB,MAAa,iBAAqC;;AAGlD,MAAa,kBAAgD;;;;;AAM7D,MAAM,cAAc,MAAc,EAAE,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,EAAE,MAAM,CAAC;;;;;;;;;;;AAmBvE,MAAa,8BACX,UAAyF,iBACzF,SAAkD,mBAClB;CAChC,MAAM,WAAW,CAAC,UACd,GAAG,kBAAkB,WAAW,cAAc,MAC9C,CAAC,eAAe,IAAI,OAAO,IACzB,UACA,GAAG,UAAU,WAAW,MAAM;CAIpC,OAAO;EAAE;EAAU,UAFF,SAAS,WAAW,gBAEX;CAAE;AAC9B;;;;;;;;;AAUA,MAAa,2BAA2B,SAKd;CACxB,IAAI,KAAK,WAAW,OAAO;CAC3B,IAAI,KAAK,UAAU,QAAQ,KAAK,WAAW,SAAS,KAAK,WAAW,IAAI,OAAO;CAC/E,IAAI,KAAK,SAAS,QAAQ,KAAK,UAAU,MAAM,KAAK,QAAQ,QAAQ,KAAK,SAAS,IAAI,OAAO;CAC7F,OAAO;AACT;;;;;AAMA,MAAa,2BAA2B,SAG8B;CACpE,IAAI,KAAK,WAAW,OAAO;EAAE,MAAM;EAAU,UAAU;CAAS;CAEhE,OADiB,KAAK,WAAW,aAAa,KAAK,WAAW,WAC5C;EAAE,MAAM;EAAS,UAAU;CAAY,IAAI;EAAE,MAAM;EAAU,UAAU;CAAS;AACpG"}
@@ -1,2 +1,2 @@
1
- import { RangeProps, RangeTrackKey, RangeValue } from "./range.types.js";
1
+ import { RangeProps, RangeValue } from "./range.types.js";
2
2
  import { Range } from "./range.js";
@@ -1 +1 @@
1
- {"version":3,"file":"range.d.ts","names":[],"sources":["../../src/range/range.tsx"],"mappings":";;;;cAoBa,KAAA,EAAK,YAAA,QAAA,UAAA"}
1
+ {"version":3,"file":"range.d.ts","names":[],"sources":["../../src/range/range.tsx"],"mappings":";;;;cA8Ea,KAAA,EAAK,YAAA,QAAA,UAAA"}
@@ -6,60 +6,78 @@ import styled from "../core/styled.js";
6
6
  import vui from "../core/vui.js";
7
7
  import Box from "../box/box.js";
8
8
  import Tooltip from "../tooltip/tooltip.js";
9
- import { jsx } from "react/jsx-runtime";
10
- import ReactSlider from "react-slider";
9
+ import { useMemo, useState } from "react";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ import * as RadixSlider from "@radix-ui/react-slider";
11
12
 
12
13
  //#region src/range/range.tsx
13
- const SliderBase = styled(ReactSlider)`
14
+ const SliderRoot = styled(Box)`
15
+ align-items: center;
16
+ cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
17
+ display: flex;
18
+ position: relative;
19
+ touch-action: none;
20
+ user-select: none;
14
21
  width: 100%;
22
+ `;
23
+ const SliderTrack = styled(Box)`
24
+ flex-grow: 1;
15
25
  height: 4px;
16
- cursor: pointer;
17
- transition-duration: '0s';
26
+ position: relative;
27
+ `;
28
+ const SliderRange = styled(Box)`
29
+ height: 100%;
30
+ position: absolute;
31
+ `;
32
+ const SliderThumb = styled(Box)`
33
+ cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "grab"};
34
+ display: block;
18
35
  `;
19
36
  const defaultFormatter = (value) => `${value}`;
37
+ const RangeThumb = ({ disabled, formatter, mainColor, showTooltip, showValue, styles, val }) => {
38
+ const formattedVal = formatter(String(val));
39
+ const thumbContent = /* @__PURE__ */ jsx(SliderThumb, {
40
+ $disabled: disabled,
41
+ className: "vui-range-thumb",
42
+ ...styles.thumb,
43
+ borderColor: mainColor,
44
+ children: showValue && /* @__PURE__ */ jsx(Box, {
45
+ center: true,
46
+ className: "vui-range-thumb-value",
47
+ ...styles.thumbValue,
48
+ children: formattedVal
49
+ })
50
+ });
51
+ const radixThumb = /* @__PURE__ */ jsx(RadixSlider.Thumb, {
52
+ asChild: true,
53
+ children: thumbContent
54
+ });
55
+ if (showTooltip === false || showTooltip === void 0 && showValue) return radixThumb;
56
+ return /* @__PURE__ */ jsx(Tooltip, {
57
+ disabled,
58
+ text: formattedVal,
59
+ visible: showTooltip,
60
+ children: radixThumb
61
+ });
62
+ };
63
+ const toArray = (val) => {
64
+ if (val === void 0) return void 0;
65
+ return Array.isArray(val) ? Array.from(val) : [val];
66
+ };
20
67
  /** Implements a range input. */
21
68
  const Range = vui((props, ref) => {
22
- const { className, value, defaultValue = 0, disabled, min = 0, minDistance = 0, max = 100, step = 1, showTooltip = false, showValue = false, formatter = defaultFormatter, onChange, ...rest } = props;
69
+ const { className, value, defaultValue = 0, disabled, min = 0, minDistance = 0, max = 100, step = 1, showTooltip, showValue = false, formatter = defaultFormatter, onChange, ...rest } = props;
23
70
  const styles = useStyleConfig("Range", props);
24
71
  const aliasedProps = filterUndefined({ "aria-disabled": disabled });
25
72
  const isSingleValue = typeof defaultValue !== "object" && typeof value !== "object";
26
73
  const mainColor = disabled ? rangeColors.disabled : rangeColors.main;
27
- const getTrackColor = (trackProps) => {
28
- const { key } = trackProps;
29
- if (isSingleValue) return key === "track-0" ? mainColor : rangeColors.track;
30
- return key === "track-2" ? rangeColors.track : key === "track-1" ? mainColor : rangeColors.track;
31
- };
32
- const Thumb = (props, state) => {
33
- const { key, ...thumbProps } = props;
34
- const thumbKey = key ?? state.index;
35
- const content = /* @__PURE__ */ jsx(Box, {
36
- className: "vui-range-thumb",
37
- ...styles.thumb,
38
- borderColor: mainColor,
39
- ...thumbProps,
40
- children: showValue && /* @__PURE__ */ jsx(Box, {
41
- center: true,
42
- className: "vui-range-thumb-value",
43
- ...styles.thumbValue,
44
- children: formatter(state.valueNow)
45
- })
46
- });
47
- return showValue ? /* @__PURE__ */ jsx(Box, { children: content }, thumbKey) : /* @__PURE__ */ jsx(Tooltip, {
48
- disabled,
49
- text: formatter(state.valueNow),
50
- visible: showTooltip,
51
- children: content
52
- }, thumbKey);
53
- };
54
- const Track = (props, state) => {
55
- const { key, ...trackProps } = props;
56
- return /* @__PURE__ */ jsx(Box, {
57
- ...styles.track,
58
- bg: getTrackColor(props),
59
- className: "vui-range-track",
60
- ...trackProps,
61
- index: state.index
62
- }, key);
74
+ const defaultArr = useMemo(() => toArray(defaultValue) ?? [0], [defaultValue]);
75
+ const valueArr = toArray(value);
76
+ const [internalValues, setInternalValues] = useState(defaultArr);
77
+ const currentValues = valueArr ?? internalValues;
78
+ const handleValueChange = (vals) => {
79
+ if (!valueArr) setInternalValues(vals);
80
+ onChange?.(isSingleValue ? vals[0] : vals);
63
81
  };
64
82
  return /* @__PURE__ */ jsx(Box, {
65
83
  className: cs("vui-range", isSingleValue ? "vui-range-single" : "vui-range-range", className),
@@ -67,19 +85,43 @@ const Range = vui((props, ref) => {
67
85
  ...styles.container,
68
86
  ...aliasedProps,
69
87
  ...rest,
70
- children: /* @__PURE__ */ jsx(SliderBase, {
71
- className: "vui-range-slider",
72
- defaultValue,
88
+ children: /* @__PURE__ */ jsx(RadixSlider.Root, {
89
+ asChild: true,
73
90
  disabled,
74
91
  max,
75
92
  min,
76
- minDistance,
77
- onChange,
78
- renderThumb: Thumb,
79
- renderTrack: Track,
93
+ minStepsBetweenThumbs: minDistance,
94
+ onValueChange: handleValueChange,
80
95
  step,
81
- value
82
- }, `${disabled}-${min}-${max}-${step}`)
96
+ ...valueArr ? { value: valueArr } : { defaultValue: defaultArr },
97
+ children: /* @__PURE__ */ jsxs(SliderRoot, {
98
+ $disabled: disabled,
99
+ className: "vui-range-slider",
100
+ children: [/* @__PURE__ */ jsx(RadixSlider.Track, {
101
+ asChild: true,
102
+ children: /* @__PURE__ */ jsx(SliderTrack, {
103
+ bg: rangeColors.track,
104
+ borderRadius: "24px",
105
+ className: "vui-range-track",
106
+ children: /* @__PURE__ */ jsx(RadixSlider.Range, {
107
+ asChild: true,
108
+ children: /* @__PURE__ */ jsx(SliderRange, {
109
+ ...styles.track,
110
+ bg: mainColor
111
+ })
112
+ })
113
+ })
114
+ }), currentValues.map((val, index) => /* @__PURE__ */ jsx(RangeThumb, {
115
+ disabled,
116
+ formatter,
117
+ mainColor,
118
+ showTooltip,
119
+ showValue,
120
+ styles,
121
+ val
122
+ }, index))]
123
+ })
124
+ })
83
125
  });
84
126
  });
85
127
  Range.displayName = "Range";
@@ -1 +1 @@
1
- {"version":3,"file":"range.js","names":[],"sources":["../../src/range/range.tsx"],"sourcesContent":["import ReactSlider from 'react-slider'\n\nimport { Box } from '../box'\nimport { styled, useStyleConfig, vui } from '../core'\nimport { Tooltip } from '../tooltip'\nimport { cs, filterUndefined } from '../utils'\nimport { rangeColors } from './consts'\nimport type { RangeProps } from './range.types'\nimport type { RangeTrackKey } from './range.types'\n\nconst SliderBase = styled(ReactSlider)`\n width: 100%;\n height: 4px;\n cursor: pointer;\n transition-duration: '0s';\n`\n\nconst defaultFormatter = (value: string) => `${value}`\n\n/** Implements a range input. */\nexport const Range = vui<'div', RangeProps>((props, ref) => {\n const {\n className,\n value,\n defaultValue = 0,\n disabled,\n min = 0,\n minDistance = 0,\n max = 100,\n step = 1,\n showTooltip = false,\n showValue = false,\n formatter = defaultFormatter,\n onChange,\n ...rest\n } = props\n\n const styles = useStyleConfig('Range', props)\n const aliasedProps = filterUndefined({\n 'aria-disabled': disabled,\n })\n const isSingleValue = typeof defaultValue !== 'object' && typeof value !== 'object'\n const mainColor = disabled ? rangeColors.disabled : rangeColors.main\n\n const getTrackColor = (trackProps: any) => {\n const { key }: { key: RangeTrackKey } = trackProps\n\n if (isSingleValue) return key === 'track-0' ? mainColor : rangeColors.track\n\n return key === 'track-2' ? rangeColors.track : key === 'track-1' ? mainColor : rangeColors.track\n }\n\n const Thumb = (props: any, state: any) => {\n const { key, ...thumbProps } = props\n const thumbKey = key ?? state.index\n const content = (\n <Box className=\"vui-range-thumb\" {...styles.thumb} borderColor={mainColor} {...thumbProps}>\n {showValue && (\n <Box center className=\"vui-range-thumb-value\" {...styles.thumbValue}>\n {formatter(state.valueNow)}\n </Box>\n )}\n </Box>\n )\n return showValue ? (\n <Box key={thumbKey}>{content}</Box>\n ) : (\n <Tooltip key={thumbKey} disabled={disabled} text={formatter(state.valueNow)} visible={showTooltip}>\n {content}\n </Tooltip>\n )\n }\n\n const Track = (\n props: any,\n state: {\n index: number\n value: number | readonly number[]\n },\n ) => {\n const { key, ...trackProps } = props\n return (\n <Box\n key={key}\n {...styles.track}\n bg={getTrackColor(props)}\n className=\"vui-range-track\"\n {...trackProps}\n index={state.index}\n />\n )\n }\n\n return (\n <Box\n className={cs('vui-range', isSingleValue ? 'vui-range-single' : 'vui-range-range', className)}\n ref={ref}\n {...styles.container}\n {...aliasedProps}\n {...rest}\n >\n <SliderBase\n key={`${disabled}-${min}-${max}-${step}`}\n className=\"vui-range-slider\"\n defaultValue={defaultValue}\n disabled={disabled}\n max={max}\n min={min}\n minDistance={minDistance}\n onChange={onChange}\n renderThumb={Thumb}\n renderTrack={Track}\n step={step}\n value={value}\n />\n </Box>\n )\n})\n\nRange.displayName = 'Range'\nexport default Range\n"],"mappings":";;;;;;;;;;;;AAUA,MAAM,aAAa,OAAO,WAAW,CAAC;;;;;;AAOtC,MAAM,oBAAoB,UAAkB,GAAG;;AAG/C,MAAa,QAAQ,KAAwB,OAAO,QAAQ;CAC1D,MAAM,EACJ,WACA,OACA,eAAe,GACf,UACA,MAAM,GACN,cAAc,GACd,MAAM,KACN,OAAO,GACP,cAAc,OACd,YAAY,OACZ,YAAY,kBACZ,UACA,GAAG,SACD;CAEJ,MAAM,SAAS,eAAe,SAAS,KAAK;CAC5C,MAAM,eAAe,gBAAgB,EACnC,iBAAiB,SACnB,CAAC;CACD,MAAM,gBAAgB,OAAO,iBAAiB,YAAY,OAAO,UAAU;CAC3E,MAAM,YAAY,WAAW,YAAY,WAAW,YAAY;CAEhE,MAAM,iBAAiB,eAAoB;EACzC,MAAM,EAAE,QAAgC;EAExC,IAAI,eAAe,OAAO,QAAQ,YAAY,YAAY,YAAY;EAEtE,OAAO,QAAQ,YAAY,YAAY,QAAQ,QAAQ,YAAY,YAAY,YAAY;CAC7F;CAEA,MAAM,SAAS,OAAY,UAAe;EACxC,MAAM,EAAE,KAAK,GAAG,eAAe;EAC/B,MAAM,WAAW,OAAO,MAAM;EAC9B,MAAM,UACJ,oBAAC,KAAD;GAAK,WAAU;GAAkB,GAAI,OAAO;GAAO,aAAa;GAAW,GAAI;aAC5E,aACC,oBAAC,KAAD;IAAK;IAAO,WAAU;IAAwB,GAAI,OAAO;cACtD,UAAU,MAAM,QAAQ;GACtB;EAEJ;EAEP,OAAO,YACL,oBAAC,KAAD,YAAqB,QAAa,GAAxB,QAAwB,IAElC,oBAAC,SAAD;GAAkC;GAAU,MAAM,UAAU,MAAM,QAAQ;GAAG,SAAS;aACnF;EACM,GAFK,QAEL;CAEb;CAEA,MAAM,SACJ,OACA,UAIG;EACH,MAAM,EAAE,KAAK,GAAG,eAAe;EAC/B,OACE,oBAAC,KAAD;GAEE,GAAI,OAAO;GACX,IAAI,cAAc,KAAK;GACvB,WAAU;GACV,GAAI;GACJ,OAAO,MAAM;EACd,GANM,GAMN;CAEL;CAEA,OACE,oBAAC,KAAD;EACE,WAAW,GAAG,aAAa,gBAAgB,qBAAqB,mBAAmB,SAAS;EACvF;EACL,GAAI,OAAO;EACX,GAAI;EACJ,GAAI;YAEJ,oBAAC,YAAD;GAEE,WAAU;GACI;GACJ;GACL;GACA;GACQ;GACH;GACV,aAAa;GACb,aAAa;GACP;GACC;EACR,GAZM,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,MAYnC;CACE;AAET,CAAC;AAED,MAAM,cAAc"}
1
+ {"version":3,"file":"range.js","names":[],"sources":["../../src/range/range.tsx"],"sourcesContent":["import * as RadixSlider from '@radix-ui/react-slider'\nimport { useMemo, useState } from 'react'\n\nimport { Box } from '../box'\nimport { styled, useStyleConfig, vui } from '../core'\nimport { Tooltip } from '../tooltip'\nimport { cs, filterUndefined } from '../utils'\nimport { rangeColors } from './consts'\nimport type { RangeProps } from './range.types'\n\nconst SliderRoot = styled(Box)<{ $disabled?: boolean }>`\n align-items: center;\n cursor: ${({ $disabled }) => ($disabled ? 'not-allowed' : 'pointer')};\n display: flex;\n position: relative;\n touch-action: none;\n user-select: none;\n width: 100%;\n`\n\nconst SliderTrack = styled(Box)`\n flex-grow: 1;\n height: 4px;\n position: relative;\n`\n\nconst SliderRange = styled(Box)`\n height: 100%;\n position: absolute;\n`\n\nconst SliderThumb = styled(Box)<{ $disabled?: boolean }>`\n cursor: ${({ $disabled }) => ($disabled ? 'not-allowed' : 'grab')};\n display: block;\n`\n\nconst defaultFormatter = (value: string) => `${value}`\n\ninterface RangeThumbProps {\n disabled?: boolean\n formatter: (value: string) => string\n mainColor: string\n showTooltip?: boolean\n showValue: boolean\n styles: ReturnType<typeof useStyleConfig>\n val: number\n}\n\nconst RangeThumb = ({ disabled, formatter, mainColor, showTooltip, showValue, styles, val }: RangeThumbProps) => {\n const formattedVal = formatter(String(val))\n\n const thumbContent = (\n <SliderThumb $disabled={disabled} className=\"vui-range-thumb\" {...styles.thumb} borderColor={mainColor}>\n {showValue && (\n <Box center className=\"vui-range-thumb-value\" {...styles.thumbValue}>\n {formattedVal}\n </Box>\n )}\n </SliderThumb>\n )\n\n const radixThumb = <RadixSlider.Thumb asChild>{thumbContent}</RadixSlider.Thumb>\n\n if (showTooltip === false || (showTooltip === undefined && showValue)) return radixThumb\n\n return (\n <Tooltip disabled={disabled} text={formattedVal} visible={showTooltip}>\n {radixThumb}\n </Tooltip>\n )\n}\n\nconst toArray = (val: number | readonly number[] | undefined): number[] | undefined => {\n if (val === undefined) return undefined\n return Array.isArray(val) ? Array.from(val as readonly number[]) : [val as number]\n}\n\n/** Implements a range input. */\nexport const Range = vui<'div', RangeProps>((props, ref) => {\n const {\n className,\n value,\n defaultValue = 0,\n disabled,\n min = 0,\n minDistance = 0,\n max = 100,\n step = 1,\n showTooltip,\n showValue = false,\n formatter = defaultFormatter,\n onChange,\n ...rest\n } = props\n\n const styles = useStyleConfig('Range', props)\n const aliasedProps = filterUndefined({\n 'aria-disabled': disabled,\n })\n const isSingleValue = typeof defaultValue !== 'object' && typeof value !== 'object'\n const mainColor = disabled ? rangeColors.disabled : rangeColors.main\n\n const defaultArr = useMemo(() => toArray(defaultValue) ?? [0], [defaultValue])\n const valueArr = toArray(value)\n\n const [internalValues, setInternalValues] = useState<number[]>(defaultArr)\n const currentValues = valueArr ?? internalValues\n\n const handleValueChange = (vals: number[]) => {\n if (!valueArr) setInternalValues(vals)\n onChange?.(isSingleValue ? vals[0] : vals)\n }\n\n return (\n <Box\n className={cs('vui-range', isSingleValue ? 'vui-range-single' : 'vui-range-range', className)}\n ref={ref}\n {...styles.container}\n {...aliasedProps}\n {...rest}\n >\n <RadixSlider.Root\n asChild\n disabled={disabled}\n max={max}\n min={min}\n minStepsBetweenThumbs={minDistance}\n onValueChange={handleValueChange}\n step={step}\n {...(valueArr ? { value: valueArr } : { defaultValue: defaultArr })}\n >\n <SliderRoot $disabled={disabled} className=\"vui-range-slider\">\n <RadixSlider.Track asChild>\n <SliderTrack bg={rangeColors.track} borderRadius=\"24px\" className=\"vui-range-track\">\n <RadixSlider.Range asChild>\n <SliderRange {...styles.track} bg={mainColor} />\n </RadixSlider.Range>\n </SliderTrack>\n </RadixSlider.Track>\n {currentValues.map((val, index) => (\n <RangeThumb\n key={index}\n disabled={disabled}\n formatter={formatter}\n mainColor={mainColor}\n showTooltip={showTooltip}\n showValue={showValue}\n styles={styles}\n val={val}\n />\n ))}\n </SliderRoot>\n </RadixSlider.Root>\n </Box>\n )\n})\n\nRange.displayName = 'Range'\nexport default Range\n"],"mappings":";;;;;;;;;;;;;AAUA,MAAM,aAAa,OAAO,GAAG,CAAC,AAAyB;;aAE1C,EAAE,gBAAiB,YAAY,gBAAgB,UAAW;;;;;;;AAQvE,MAAM,cAAc,OAAO,GAAG,CAAC;;;;;AAM/B,MAAM,cAAc,OAAO,GAAG,CAAC;;;;AAK/B,MAAM,cAAc,OAAO,GAAG,CAAC,AAAyB;aAC3C,EAAE,gBAAiB,YAAY,gBAAgB,OAAQ;;;AAIpE,MAAM,oBAAoB,UAAkB,GAAG;AAY/C,MAAM,cAAc,EAAE,UAAU,WAAW,WAAW,aAAa,WAAW,QAAQ,UAA2B;CAC/G,MAAM,eAAe,UAAU,OAAO,GAAG,CAAC;CAE1C,MAAM,eACJ,oBAAC,aAAD;EAAa,WAAW;EAAU,WAAU;EAAkB,GAAI,OAAO;EAAO,aAAa;YAC1F,aACC,oBAAC,KAAD;GAAK;GAAO,WAAU;GAAwB,GAAI,OAAO;aACtD;EACE;CAEI;CAGf,MAAM,aAAa,oBAAC,YAAY,OAAb;EAAmB;YAAS;CAAgC;CAE/E,IAAI,gBAAgB,SAAU,gBAAgB,UAAa,WAAY,OAAO;CAE9E,OACE,oBAAC,SAAD;EAAmB;EAAU,MAAM;EAAc,SAAS;YACvD;CACM;AAEb;AAEA,MAAM,WAAW,QAAsE;CACrF,IAAI,QAAQ,QAAW,OAAO;CAC9B,OAAO,MAAM,QAAQ,GAAG,IAAI,MAAM,KAAK,GAAwB,IAAI,CAAC,GAAa;AACnF;;AAGA,MAAa,QAAQ,KAAwB,OAAO,QAAQ;CAC1D,MAAM,EACJ,WACA,OACA,eAAe,GACf,UACA,MAAM,GACN,cAAc,GACd,MAAM,KACN,OAAO,GACP,aACA,YAAY,OACZ,YAAY,kBACZ,UACA,GAAG,SACD;CAEJ,MAAM,SAAS,eAAe,SAAS,KAAK;CAC5C,MAAM,eAAe,gBAAgB,EACnC,iBAAiB,SACnB,CAAC;CACD,MAAM,gBAAgB,OAAO,iBAAiB,YAAY,OAAO,UAAU;CAC3E,MAAM,YAAY,WAAW,YAAY,WAAW,YAAY;CAEhE,MAAM,aAAa,cAAc,QAAQ,YAAY,KAAK,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC;CAC7E,MAAM,WAAW,QAAQ,KAAK;CAE9B,MAAM,CAAC,gBAAgB,qBAAqB,SAAmB,UAAU;CACzE,MAAM,gBAAgB,YAAY;CAElC,MAAM,qBAAqB,SAAmB;EAC5C,IAAI,CAAC,UAAU,kBAAkB,IAAI;EACrC,WAAW,gBAAgB,KAAK,KAAK,IAAI;CAC3C;CAEA,OACE,oBAAC,KAAD;EACE,WAAW,GAAG,aAAa,gBAAgB,qBAAqB,mBAAmB,SAAS;EACvF;EACL,GAAI,OAAO;EACX,GAAI;EACJ,GAAI;YAEJ,oBAAC,YAAY,MAAb;GACE;GACU;GACL;GACA;GACL,uBAAuB;GACvB,eAAe;GACT;GACN,GAAK,WAAW,EAAE,OAAO,SAAS,IAAI,EAAE,cAAc,WAAW;aAEjE,qBAAC,YAAD;IAAY,WAAW;IAAU,WAAU;cAA3C,CACE,oBAAC,YAAY,OAAb;KAAmB;eACjB,oBAAC,aAAD;MAAa,IAAI,YAAY;MAAO,cAAa;MAAO,WAAU;gBAChE,oBAAC,YAAY,OAAb;OAAmB;iBACjB,oBAAC,aAAD;QAAa,GAAI,OAAO;QAAO,IAAI;OAAY;MAC9B;KACR;IACI,IAClB,cAAc,KAAK,KAAK,UACvB,oBAAC,YAAD;KAEY;KACC;KACA;KACE;KACF;KACH;KACH;IACN,GARM,KAQN,CACF,CACS;;EACI;CACf;AAET,CAAC;AAED,MAAM,cAAc"}
@@ -9,14 +9,13 @@ type RangeProps = SystemProps & ThemingProps<'Range'> & {
9
9
  min?: number; /** The minimum value of the range slider. @default 100 */
10
10
  max?: number; /** The minimum distance between two values in the range slider. @default 0 */
11
11
  minDistance?: number; /** The step increment of the range slider. @default 1 */
12
- step?: number; /** Whether to show a tooltip with the current value. @default false */
12
+ step?: number; /** Controls tooltip visibility. Omit to show on hover (default), `true` to always show, `false` to hide. When `showValue` is `true`, the tooltip is hidden by default. */
13
13
  showTooltip?: boolean; /** Whether to show the current value bellow the thumb. @default false */
14
14
  showValue?: boolean; /** Function used to format the display value. */
15
15
  formatter?: (value: string) => string; /** Callback function that is called when the value changes. */
16
16
  onChange?: (value: RangeValue) => void;
17
17
  };
18
- type RangeTrackKey = 'track-0' | 'track-1' | 'track-2';
19
18
  //#endregion
20
- export { RangeProps, RangeTrackKey, RangeValue };
19
+ export { RangeProps, RangeValue };
21
20
 
22
21
  //# sourceMappingURL=range.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"range.types.d.ts","names":[],"sources":["../../src/range/range.types.ts"],"mappings":";;;KAGY,UAAA;AAAA,KAEA,UAAA,GAAa,WAAA,GACvB,YAAA;sFAEE,YAAA,GAAe,UAAA,EALP;EAOR,KAAA,GAAQ,UAAA;EAER,QAAA,YATkB;EAWlB,GAAA,WATkB;EAWlB,GAAA,WAXqB;EAarB,WAAA,WAVe;EAYf,IAAA,WAQmB;EANnB,WAAA,YAM6B;EAJ7B,SAAA,YAlBF;EAoBE,SAAA,IAAa,KAAA,qBAlBE;EAoBf,QAAA,IAAY,KAAA,EAAO,UAAA;AAAA;AAAA,KAGX,aAAA"}
1
+ {"version":3,"file":"range.types.d.ts","names":[],"sources":["../../src/range/range.types.ts"],"mappings":";;;KAGY,UAAA;AAAA,KAEA,UAAA,GAAa,WAAA,GACvB,YAAA;sFAEE,YAAA,GAAe,UAAA,EALP;EAOR,KAAA,GAAQ,UAAA;EAER,QAAA,YATkB;EAWlB,GAAA,WATkB;EAWlB,GAAA,WAXqB;EAarB,WAAA,WAVe;EAYf,IAAA,WAQmB;EANnB,WAAA,YAM6B;EAJ7B,SAAA,YAlBF;EAoBE,SAAA,IAAa,KAAA,qBAlBE;EAoBf,QAAA,IAAY,KAAA,EAAO,UAAA;AAAA"}
@@ -5,14 +5,12 @@ const baseStyle = {
5
5
  container: { w: 1 },
6
6
  thumb: {
7
7
  bg: "white",
8
- border: `2px solid ${rangeColors.main}`,
8
+ border: "2px solid",
9
9
  borderRadius: "24px",
10
- cursor: "grab",
11
10
  h: "24px",
12
11
  lineHeight: "24px",
13
12
  w: "24px",
14
13
  textAlign: "center",
15
- top: "-10px",
16
14
  transitionDuration: "0s"
17
15
  },
18
16
  thumbValue: {
@@ -22,9 +20,7 @@ const baseStyle = {
22
20
  },
23
21
  track: {
24
22
  bg: rangeColors.main,
25
- bottom: 0,
26
23
  borderRadius: "24px",
27
- top: 0,
28
24
  transitionDuration: "0s"
29
25
  }
30
26
  };