@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.
- package/dist/badge/badge.d.ts.map +1 -1
- package/dist/badge/badge.js +1 -8
- package/dist/badge/badge.js.map +1 -1
- package/dist/button/buttonText.js +1 -1
- package/dist/button/buttons.d.ts +1 -2
- package/dist/button/buttons.d.ts.map +1 -1
- package/dist/button/buttons.js +5 -21
- package/dist/button/buttons.js.map +1 -1
- package/dist/button/index.d.ts +1 -1
- package/dist/dialog/dialogCloseButton.js +1 -1
- package/dist/dialog/dialogCloseButton.js.map +1 -1
- package/dist/dismissButton/DismissButton.d.ts +34 -0
- package/dist/dismissButton/DismissButton.d.ts.map +1 -0
- package/dist/dismissButton/DismissButton.js +69 -0
- package/dist/dismissButton/DismissButton.js.map +1 -0
- package/dist/dismissButton/index.d.ts +1 -0
- package/dist/dismissButton/theme.js +33 -0
- package/dist/dismissButton/theme.js.map +1 -0
- package/dist/header/loggedInHeader.js +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.js +10 -9
- package/dist/notification/index.d.ts +1 -1
- package/dist/notification/notification.d.ts.map +1 -1
- package/dist/notification/notification.js +27 -6
- package/dist/notification/notification.js.map +1 -1
- package/dist/notification/notification.types.d.ts +26 -7
- package/dist/notification/notification.types.d.ts.map +1 -1
- package/dist/notification/notificationAction.d.ts.map +1 -1
- package/dist/notification/notificationAction.js +6 -1
- package/dist/notification/notificationAction.js.map +1 -1
- package/dist/notification/theme.js +25 -10
- package/dist/notification/theme.js.map +1 -1
- package/dist/notification/utils.js +39 -10
- package/dist/notification/utils.js.map +1 -1
- package/dist/range/index.d.ts +1 -1
- package/dist/range/range.d.ts.map +1 -1
- package/dist/range/range.js +93 -51
- package/dist/range/range.js.map +1 -1
- package/dist/range/range.types.d.ts +2 -3
- package/dist/range/range.types.d.ts.map +1 -1
- package/dist/range/theme.js +1 -5
- package/dist/range/theme.js.map +1 -1
- package/dist/stepIndicator/stepIndicator.js +1 -0
- package/dist/stepIndicator/stepIndicator.js.map +1 -1
- package/dist/tabs/tabsNavBar.js +2 -2
- package/dist/tabs/tabsNavBar.js.map +1 -1
- package/dist/tag/index.d.ts +1 -1
- package/dist/tag/tag.d.ts.map +1 -1
- package/dist/tag/tag.js +4 -4
- package/dist/tag/tag.js.map +1 -1
- package/dist/tag/tag.types.d.ts +9 -9
- package/dist/tag/tag.types.d.ts.map +1 -1
- package/dist/tag/theme.js +13 -33
- package/dist/tag/theme.js.map +1 -1
- package/dist/tag/utils.d.ts +7 -7
- package/dist/tag/utils.d.ts.map +1 -1
- package/dist/tag/utils.js +8 -8
- package/dist/tag/utils.js.map +1 -1
- package/dist/theme/components.d.ts +33 -16
- package/dist/theme/components.js +88 -86
- package/dist/theme/components.js.map +1 -1
- package/dist/theme/defaultTheme.d.ts +33 -16
- package/dist/theme/types.d.ts +3 -1
- package/dist/theme/types.d.ts.map +1 -1
- package/dist/toast/useToast.d.ts.map +1 -1
- package/dist/toast/useToast.js +2 -0
- package/dist/toast/useToast.js.map +1 -1
- package/dist/tutorial/tutorialCard.js +2 -1
- package/dist/tutorial/tutorialCard.js.map +1 -1
- package/package.json +5 -3
- package/skills/build-with-vui/SKILL.md +1 -1
- 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 {
|
|
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; /**
|
|
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;
|
|
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 & {}); /**
|
|
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,
|
|
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":";;;;
|
|
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
|
|
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',
|
|
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-
|
|
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 = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
57
|
+
fontSize: "16px",
|
|
58
|
+
lineHeight: "150%",
|
|
59
|
+
fontWeight: 400,
|
|
49
60
|
minW: 0
|
|
50
61
|
},
|
|
51
|
-
title: { mb: "
|
|
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 (
|
|
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
|
|
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
|
-
*
|
|
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
|
|
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
|
|
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 {
|
|
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"}
|
package/dist/range/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RangeProps,
|
|
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":";;;;
|
|
1
|
+
{"version":3,"file":"range.d.ts","names":[],"sources":["../../src/range/range.tsx"],"mappings":";;;;cA8Ea,KAAA,EAAK,YAAA,QAAA,UAAA"}
|
package/dist/range/range.js
CHANGED
|
@@ -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 {
|
|
10
|
-
import
|
|
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
|
|
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
|
-
|
|
17
|
-
|
|
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
|
|
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
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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(
|
|
71
|
-
|
|
72
|
-
defaultValue,
|
|
88
|
+
children: /* @__PURE__ */ jsx(RadixSlider.Root, {
|
|
89
|
+
asChild: true,
|
|
73
90
|
disabled,
|
|
74
91
|
max,
|
|
75
92
|
min,
|
|
76
|
-
minDistance,
|
|
77
|
-
|
|
78
|
-
renderThumb: Thumb,
|
|
79
|
-
renderTrack: Track,
|
|
93
|
+
minStepsBetweenThumbs: minDistance,
|
|
94
|
+
onValueChange: handleValueChange,
|
|
80
95
|
step,
|
|
81
|
-
value
|
|
82
|
-
|
|
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";
|
package/dist/range/range.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range.js","names":[],"sources":["../../src/range/range.tsx"],"sourcesContent":["import
|
|
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; /**
|
|
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,
|
|
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
|
|
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"}
|
package/dist/range/theme.js
CHANGED
|
@@ -5,14 +5,12 @@ const baseStyle = {
|
|
|
5
5
|
container: { w: 1 },
|
|
6
6
|
thumb: {
|
|
7
7
|
bg: "white",
|
|
8
|
-
border:
|
|
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
|
};
|