@proyecto-viviana/ui 0.6.2 → 0.6.3
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/_chunk/LinkButton.js +9 -9
- package/dist/_chunk/LinkButton.js.map +1 -1
- package/dist/_chunk/LinkButton.jsx +9 -9
- package/dist/_chunk/LinkButton.jsx.map +1 -1
- package/dist/_chunk/RangeCalendar.js +7 -7
- package/dist/_chunk/RangeCalendar.js.map +1 -1
- package/dist/_chunk/RangeCalendar.jsx +7 -7
- package/dist/_chunk/RangeCalendar.jsx.map +1 -1
- package/dist/_chunk/Tabs.js +2 -2
- package/dist/_chunk/Tabs.jsx +2 -2
- package/dist/_chunk/breadcrumbs.js +2 -2
- package/dist/_chunk/breadcrumbs.js.map +1 -1
- package/dist/_chunk/breadcrumbs.jsx +2 -2
- package/dist/_chunk/breadcrumbs.jsx.map +1 -1
- package/dist/_chunk/button.js +3 -3
- package/dist/_chunk/button.jsx +3 -3
- package/dist/_chunk/color.js +4 -4
- package/dist/_chunk/color.jsx +4 -4
- package/dist/_chunk/form.js +5 -7
- package/dist/_chunk/form.js.map +1 -1
- package/dist/_chunk/form.jsx +5 -8
- package/dist/_chunk/form.jsx.map +1 -1
- package/dist/_chunk/layout.js +5 -1
- package/dist/_chunk/layout.js.map +1 -1
- package/dist/_chunk/layout.jsx +5 -1
- package/dist/_chunk/layout.jsx.map +1 -1
- package/dist/_chunk/list.js +4 -4
- package/dist/_chunk/list.jsx +4 -4
- package/dist/_chunk/menu.js +1 -1
- package/dist/_chunk/menu.js.map +1 -1
- package/dist/_chunk/menu.jsx +1 -1
- package/dist/_chunk/menu.jsx.map +1 -1
- package/dist/_chunk/numberfield.js +2 -2
- package/dist/_chunk/numberfield.jsx +2 -2
- package/dist/_chunk/s2-action-button-styles.js +8 -8
- package/dist/_chunk/s2-action-button-styles.js.map +1 -1
- package/dist/_chunk/s2-action-button-styles.jsx +8 -8
- package/dist/_chunk/s2-action-button-styles.jsx.map +1 -1
- package/dist/_chunk/s2-menu-styles.js +1 -1
- package/dist/_chunk/s2-menu-styles.jsx +1 -1
- package/dist/_chunk/slider.js +6 -6
- package/dist/_chunk/slider.jsx +6 -6
- package/dist/_chunk/switch.js +2 -2
- package/dist/_chunk/switch.jsx +2 -2
- package/dist/_chunk/table.js +3 -3
- package/dist/_chunk/table.js.map +1 -1
- package/dist/_chunk/table.jsx +3 -3
- package/dist/_chunk/table.jsx.map +1 -1
- package/dist/_chunk/text.js +1 -1
- package/dist/_chunk/text.jsx +1 -1
- package/dist/_chunk/textfield.js +4 -4
- package/dist/_chunk/textfield.jsx +4 -4
- package/dist/_chunk/toast.js +3 -3
- package/dist/_chunk/toast.jsx +3 -3
- package/dist/actiongroup/index.js +2 -2
- package/dist/actiongroup/index.jsx +2 -2
- package/dist/badge/index.js +6 -6
- package/dist/badge/index.jsx +6 -6
- package/dist/breadcrumbs/index.d.ts.map +1 -1
- package/dist/calendar/DateField.d.ts.map +1 -1
- package/dist/calendar/DateField.js +2 -2
- package/dist/calendar/DateField.js.map +1 -1
- package/dist/calendar/DateField.jsx +2 -2
- package/dist/calendar/DateField.jsx.map +1 -1
- package/dist/calendar/DatePicker.d.ts.map +1 -1
- package/dist/calendar/DatePicker.js +2 -2
- package/dist/calendar/DatePicker.js.map +1 -1
- package/dist/calendar/DatePicker.jsx +2 -2
- package/dist/calendar/DatePicker.jsx.map +1 -1
- package/dist/calendar/DateRangePicker.js +2 -2
- package/dist/calendar/DateRangePicker.jsx +2 -2
- package/dist/calendar/RangeCalendar.d.ts.map +1 -1
- package/dist/calendar/TimeField.d.ts.map +1 -1
- package/dist/calendar/TimeField.js +2 -2
- package/dist/calendar/TimeField.js.map +1 -1
- package/dist/calendar/TimeField.jsx +2 -2
- package/dist/calendar/TimeField.jsx.map +1 -1
- package/dist/calendar/index.js +5 -5
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/index.jsx +5 -5
- package/dist/calendar/index.jsx.map +1 -1
- package/dist/checkbox/index.js +3 -3
- package/dist/checkbox/index.jsx +3 -3
- package/dist/combobox/index.js +2 -2
- package/dist/combobox/index.jsx +2 -2
- package/dist/dropzone/index.js +1 -1
- package/dist/dropzone/index.jsx +1 -1
- package/dist/form/index.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelChartIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelChartIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelChartIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelCheckIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelCheckIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelCheckIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelChevronDownIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelChevronDownIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelChevronDownIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelChevronRightIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelChevronRightIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelChevronRightIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelClockIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelClockIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelClockIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelCodeIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelCodeIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelCodeIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelCommunityIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelCommunityIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelCommunityIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelCubeIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelCubeIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelCubeIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelFlameIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelFlameIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelFlameIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelHomeIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelHomeIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelHomeIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelLayoutIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelLayoutIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelLayoutIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelMessageIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelMessageIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelMessageIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNavCommunityIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNavCommunityIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNavCommunityIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNavExploreIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNavExploreIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNavExploreIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNavLiveIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNavLiveIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNavLiveIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNavPathwaysIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNavPathwaysIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNavPathwaysIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNavPlaygroundIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNavPlaygroundIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNavPlaygroundIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNavProjectsIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNavProjectsIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNavProjectsIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNavReferenceIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNavReferenceIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNavReferenceIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNavSettingsIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNavSettingsIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNavSettingsIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNavTopicsIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNavTopicsIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNavTopicsIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelNotificationIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelNotificationIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelNotificationIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelPathwaysIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelPathwaysIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelPathwaysIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelPlayIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelPlayIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelPlayIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelSearchIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelSearchIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelSearchIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelSettingsIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelSettingsIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelSettingsIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelSparkleIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelSparkleIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelSparkleIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelTopicsIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelTopicsIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelTopicsIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelUserIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelUserIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelUserIcon.jsx.map +1 -1
- package/dist/icon/pixel-icons/PixelZapIcon.d.ts.map +1 -1
- package/dist/icon/pixel-icons/PixelZapIcon.js.map +1 -1
- package/dist/icon/pixel-icons/PixelZapIcon.jsx.map +1 -1
- package/dist/inlinealert/index.js +6 -6
- package/dist/inlinealert/index.jsx +6 -6
- package/dist/labeledvalue/index.js +1 -1
- package/dist/labeledvalue/index.jsx +1 -1
- package/dist/layout/Flex.d.ts +2 -0
- package/dist/layout/Flex.d.ts.map +1 -1
- package/dist/link/index.d.ts.map +1 -1
- package/dist/link/index.js +1 -4
- package/dist/link/index.js.map +1 -1
- package/dist/link/index.jsx +1 -4
- package/dist/link/index.jsx.map +1 -1
- package/dist/listbox/index.js +3 -3
- package/dist/listbox/index.jsx +4 -4
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/meter/index.d.ts.map +1 -1
- package/dist/meter/index.js +2 -2
- package/dist/meter/index.js.map +1 -1
- package/dist/meter/index.jsx +2 -2
- package/dist/meter/index.jsx.map +1 -1
- package/dist/notificationbadge/index.js +1 -1
- package/dist/notificationbadge/index.jsx +1 -1
- package/dist/picker/index.js +3 -3
- package/dist/picker/index.jsx +3 -3
- package/dist/popover/index.js +1 -1
- package/dist/popover/index.jsx +1 -1
- package/dist/progress/ProgressCircle.js +2 -2
- package/dist/progress/ProgressCircle.js.map +1 -1
- package/dist/progress/ProgressCircle.jsx +2 -2
- package/dist/progress/ProgressCircle.jsx.map +1 -1
- package/dist/progress-bar/index.js +4 -4
- package/dist/progress-bar/index.jsx +4 -4
- package/dist/radio/index.js +2 -2
- package/dist/radio/index.jsx +2 -2
- package/dist/searchfield/index.js +2 -2
- package/dist/searchfield/index.jsx +2 -2
- package/dist/segmentedcontrol/index.js +2 -5
- package/dist/segmentedcontrol/index.js.map +1 -1
- package/dist/segmentedcontrol/index.jsx +2 -5
- package/dist/segmentedcontrol/index.jsx.map +1 -1
- package/dist/select/index.js +3 -3
- package/dist/select/index.jsx +3 -3
- package/dist/selectboxgroup/index.js +1 -1
- package/dist/selectboxgroup/index.jsx +1 -1
- package/dist/statuslight/index.js +1 -1
- package/dist/statuslight/index.jsx +1 -1
- package/dist/steplist/index.js +5 -5
- package/dist/steplist/index.jsx +5 -5
- package/dist/style/glasselated-ramps.d.ts.map +1 -1
- package/dist/style/index.js +18 -9
- package/dist/style/index.js.map +1 -1
- package/dist/style/spectrum-theme.d.ts +7 -7
- package/dist/style/spectrum-theme.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/table/index.d.ts.map +1 -1
- package/dist/tag-group/index.js +10 -10
- package/dist/tag-group/index.js.map +1 -1
- package/dist/tag-group/index.jsx +10 -10
- package/dist/tag-group/index.jsx.map +1 -1
- package/dist/toolbar/index.d.ts.map +1 -1
- package/dist/toolbar/index.js.map +1 -1
- package/dist/toolbar/index.jsx.map +1 -1
- package/dist/tree/index.d.ts.map +1 -1
- package/dist/tree/index.js +5 -5
- package/dist/tree/index.js.map +1 -1
- package/dist/tree/index.jsx +5 -5
- package/dist/tree/index.jsx.map +1 -1
- package/dist/viviana-tokens.css +39 -12
- package/package.json +18 -5
- package/src/breadcrumbs/index.tsx +14 -7
- package/src/button/s2-action-button-styles.ts +8 -8
- package/src/button/s2-button-styles.ts +8 -8
- package/src/calendar/DateField.tsx +2 -6
- package/src/calendar/DatePicker.tsx +8 -1
- package/src/calendar/RangeCalendar.tsx +13 -7
- package/src/calendar/TimeField.tsx +2 -6
- package/src/calendar/index.tsx +4 -4
- package/src/form/index.tsx +5 -6
- package/src/icon/pixel-icons/PixelChartIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelCheckIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelChevronDownIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelChevronRightIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelClockIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelCodeIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelCommunityIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelCubeIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelFlameIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelHomeIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelLayoutIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelMessageIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNavCommunityIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNavExploreIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNavLiveIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNavPathwaysIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNavPlaygroundIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNavProjectsIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNavReferenceIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNavSettingsIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNavTopicsIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelNotificationIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelPathwaysIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelPlayIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelSearchIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelSettingsIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelSparkleIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelTopicsIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelUserIcon.tsx +4 -1
- package/src/icon/pixel-icons/PixelZapIcon.tsx +4 -1
- package/src/layout/Flex.tsx +7 -0
- package/src/link/index.tsx +3 -1
- package/src/menu/index.tsx +1 -3
- package/src/meter/index.tsx +1 -3
- package/src/progress/ProgressCircle.tsx +1 -1
- package/src/segmentedcontrol/index.tsx +6 -6
- package/src/style/glasselated-ramps.ts +37 -33
- package/src/style/spectrum-theme.ts +22 -17
- package/src/table/index.tsx +1 -3
- package/src/tag-group/index.tsx +8 -8
- package/src/toolbar/index.tsx +4 -1
- package/src/tree/index.tsx +3 -11
- package/src/viviana-tokens.css +39 -12
package/dist/meter/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/meter/index.tsx"],"sourcesContent":["import {\n type JSX,\n For,\n createContext,\n createMemo,\n createUniqueId,\n mergeProps,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport { createMeter } from \"@proyecto-viviana/solidaria\";\nimport { SkeletonWrapper } from \"../skeleton\";\nimport { Text } from \"../text\";\nimport type { StyleString } from \"../style\";\nimport { lightDark, style } from \"../style\" with { type: \"macro\" };\nimport type { UnsafeClassName } from \"../s2-internal/style-utils\";\nimport {\n centerPadding,\n controlSize,\n fieldInput,\n fieldLabel,\n fieldValue,\n getAllowedOverrides,\n staticColor as staticColorStyles,\n} from \"../s2-internal/style-utils\" with { type: \"macro\" };\nimport {\n getSlottedContextProps,\n mergeContextRefs,\n mergeContextStyles,\n mergeContextUnsafeStyle,\n type RefLike,\n type SpectrumContextValue,\n} from \"../button/spectrum-context\";\n\ntype MeterSize = \"S\" | \"M\" | \"L\" | \"XL\";\ntype MeterVariant = \"informative\" | \"positive\" | \"notice\" | \"negative\";\n/* `success` and `warning` are accepted alias names for `positive`/`notice` — the\n * negative/warning/success status trio Button and Badge also expose — folded onto\n * the canonical channel by normalizeVariant before styling. */\ntype MeterVariantProp = MeterVariant | \"success\" | \"warning\";\ntype MeterStaticColor = \"white\" | \"black\" | \"auto\";\ntype MeterLabelPosition = \"top\" | \"side\";\n\nfunction normalizeVariant(variant: MeterVariantProp | undefined): MeterVariant {\n switch (variant) {\n case \"success\":\n return \"positive\";\n case \"warning\":\n return \"notice\";\n default:\n return variant ?? \"informative\";\n }\n}\n\nexport interface MeterProps {\n /** The current value (controlled). @default 0 */\n value?: number;\n /** The smallest value allowed. @default 0 */\n minValue?: number;\n /** The largest value allowed. @default 100 */\n maxValue?: number;\n /** The content to display as the value's label (e.g. \"75 GB\"). */\n valueLabel?: JSX.Element;\n /** The display format of the value label. */\n formatOptions?: Intl.NumberFormatOptions;\n /** The size of the meter. @default 'M' */\n size?: MeterSize;\n /**\n * Render the meter as this many discrete blocks instead of a continuous bar —\n * the register's `[▮▮▮▯▯]` capacity form (Panel07's focus/streak/xp/memory\n * rows, TerminalGlassLab.tsx:914-931). The value quantizes to\n * `round(fraction × segments)` filled blocks; the accessible value stays\n * continuous.\n */\n segments?: number;\n /** The visual style variant. `success`/`warning` alias `positive`/`notice`. @default 'informative' */\n variant?: MeterVariantProp;\n /** The label to display above the meter. */\n label?: JSX.Element;\n /** The static color style to apply over a color background. */\n staticColor?: MeterStaticColor;\n /** The label's overall position relative to the meter. @default 'top' */\n labelPosition?: MeterLabelPosition;\n /** Spectrum-defined generated classes. */\n styles?: StyleString | (() => StyleString | undefined);\n /** Additional CSS class name. Use only as a last resort. */\n UNSAFE_className?: UnsafeClassName | string;\n /** Additional inline styles. Use only as a last resort. */\n UNSAFE_style?: JSX.CSSProperties;\n id?: string;\n slot?: string | null;\n ref?: RefLike<HTMLDivElement>;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n \"aria-describedby\"?: string;\n \"aria-details\"?: string;\n [key: `data-${string}`]: string | undefined;\n}\n\nexport const MeterContext = createContext<SpectrumContextValue<MeterProps>>(null);\n\ntype MeterStyleState = {\n size: MeterSize;\n variant: MeterVariant;\n staticColor?: MeterStaticColor;\n labelPosition: MeterLabelPosition;\n labelAlign?: \"start\" | \"end\";\n isStaticColor: boolean;\n isSegmented: boolean;\n};\n\nconst wrapperStyles = style<MeterStyleState>(\n {\n ...staticColorStyles(),\n position: \"relative\",\n display: \"grid\",\n gridTemplateColumns: {\n labelPosition: {\n top: [\"1fr\", \"auto\"],\n side: [\"auto\", \"1fr\"],\n },\n },\n gridTemplateAreas: {\n labelPosition: {\n top: [\"label value\", \"bar bar\"],\n side: [\"label bar value\"],\n },\n },\n alignItems: \"baseline\",\n isolation: \"isolate\",\n minWidth: 48,\n maxWidth: 768,\n \"--field-height\": {\n type: \"height\",\n value: controlSize(),\n },\n \"--track-to-label\": {\n type: \"height\",\n value: 4,\n },\n \"--field-gap\": {\n type: \"rowGap\",\n value: centerPadding(\"calc(var(--field-height) + var(--track-to-label))\"),\n },\n columnGap: 12,\n },\n getAllowedOverrides(),\n);\n\nconst labelWrapperStyles = style<MeterStyleState>({\n gridArea: \"label\",\n display: \"inline\",\n textAlign: {\n labelAlign: {\n start: \"start\",\n end: \"end\",\n },\n },\n paddingBottom: {\n labelPosition: {\n top: \"--field-gap\",\n },\n },\n contain: {\n labelPosition: {\n /* Size containment here relies on the bar row to size the grid — the\n * continuous track advertises a 208px intrinsic width (fieldInput's\n * containIntrinsicWidth). The segment row is content-sized (a handful of\n * 7px blocks), so with segments the label must contribute its own width\n * or the value overprints it. */\n top: {\n default: \"inline-size\",\n isSegmented: \"none\",\n },\n },\n },\n});\n\nconst labelStyles = style<MeterStyleState>({\n ...fieldLabel(),\n});\n\nconst valueStyles = style<MeterStyleState>({\n ...fieldValue(),\n gridArea: \"value\",\n});\n\nconst trackStyles = style<MeterStyleState>({\n ...fieldInput(),\n gridArea: \"bar\",\n /* Containing block for the rim overlay below. wrapperStyles above is already\n * `position: \"relative\"`, so without this the overlay's `inset: 0` would\n * resolve against the whole component and rim the label and value rows too.\n * `zIndex: 1` below is unaffected: it already applied without positioning\n * (the track is a grid item), and it keeps applying now. */\n position: \"relative\",\n overflow: \"hidden\",\n /* Square, matching ProgressBar's track. The register's bar primitive (the XP\n * bar in design-handoff-v2/TerminalGlassLab.tsx) declares no border-radius on\n * either the track or the fill, so both compute to 0. */\n borderRadius: \"none\",\n backgroundColor: {\n /* The register's recessed surface: the same `var(--surface-inset)` the\n * handoff's bar track paints, and the same one ProgressBar uses. */\n default: \"pasteboard\",\n isStaticColor: \"transparent-overlay-300\",\n forcedColors: \"ButtonFace\",\n },\n outlineWidth: {\n default: 0,\n forcedColors: 1,\n },\n outlineStyle: {\n default: \"none\",\n forcedColors: \"solid\",\n },\n outlineColor: {\n default: \"transparent\",\n forcedColors: \"ButtonText\",\n },\n zIndex: 1,\n height: {\n default: 6,\n size: {\n S: 4,\n M: 6,\n L: 8,\n XL: 10,\n },\n },\n});\n\n/* The rim goes on its own absolutely-positioned layer rather than on trackStyles,\n * which is how the handoff paints it too (design-handoff-v2/TerminalGlassLab.tsx\n * lays an `inset: 0` / `pointer-events: none` / `box-shadow: var(--edge-glass)`\n * div over the bar's fills). The reason it cannot live on the track: an inset\n * box-shadow is painted with the element's own background, beneath every in-flow\n * descendant. `overflow: hidden` clips the fill but does not lift the track's\n * inset shadow above it, so a rim declared on the track would be occluded across\n * the filled fraction and survive only on the empty remainder — a half-rim that\n * reads as a bug. Kept local rather than shared with ProgressBar: the two have no\n * common style module today and inventing one widens a two-site fix. */\nconst trackRimStyles = style({\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n borderRadius: \"inherit\",\n boxShadow: \"edge-glass\",\n});\n\nconst fillStyles = style<MeterStyleState>({\n height: \"full\",\n borderStyle: \"none\",\n borderRadius: \"none\",\n backgroundColor: {\n default: lightDark(\"informative-800\", \"informative-900\"),\n variant: {\n positive: lightDark(\"positive-800\", \"positive-900\"),\n notice: lightDark(\"notice-800\", \"notice-900\"),\n negative: lightDark(\"negative-800\", \"negative-900\"),\n },\n isStaticColor: \"transparent-overlay-900\",\n forcedColors: \"ButtonText\",\n },\n});\n\n/* The discrete form. The register draws it as literal ▮/▯ glyphs in mono text\n * (TerminalGlassLab.tsx:918: `[▮▮▮▯▯] 3/5`); as a library primitive the blocks\n * are drawn divs at the glyph's box (7×12 — U+25AE's ink at the wells' 11.5px\n * mono), because a glyph's rendered size shifts with the consumer's font stack.\n * Filled and empty share one ink — the glyph pair differs only in fill, and the\n * register keeps channel color OFF the blocks (it lives on the row label). Here\n * the ink follows the variant so the meter still reads outside a well. No rim:\n * the blocks are marks, not a recessed surface. */\n/* Static (no conditions), so the macro yields a string used directly as a\n * class — same pattern as trackRimStyles above. */\nconst segmentRowStyles = style({\n gridArea: \"bar\",\n display: \"flex\",\n alignItems: \"center\",\n columnGap: \"[3px]\",\n});\n\ntype MeterSegmentStyleState = MeterStyleState & { isFilled: boolean };\n\nconst segmentStyles = style<MeterSegmentStyleState>({\n width: 7,\n height: 12,\n boxSizing: \"border-box\",\n borderStyle: \"solid\",\n borderWidth: 1,\n borderColor: {\n default: lightDark(\"informative-800\", \"informative-900\"),\n variant: {\n positive: lightDark(\"positive-800\", \"positive-900\"),\n notice: lightDark(\"notice-800\", \"notice-900\"),\n negative: lightDark(\"negative-800\", \"negative-900\"),\n },\n isStaticColor: \"transparent-overlay-900\",\n forcedColors: \"ButtonText\",\n },\n backgroundColor: {\n default: \"transparent\",\n isFilled: {\n default: lightDark(\"informative-800\", \"informative-900\"),\n variant: {\n positive: lightDark(\"positive-800\", \"positive-900\"),\n notice: lightDark(\"notice-800\", \"notice-900\"),\n negative: lightDark(\"negative-800\", \"negative-900\"),\n },\n isStaticColor: \"transparent-overlay-900\",\n forcedColors: \"ButtonText\",\n },\n },\n});\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\nfunction stringValueLabel(value: JSX.Element | undefined): string | undefined {\n if (typeof value === \"string\" || typeof value === \"number\") {\n return String(value);\n }\n return undefined;\n}\n\nfunction getDataAttributes(source: object): JSX.HTMLAttributes<HTMLDivElement> {\n const record = source as Record<string, unknown>;\n const attributes: Record<string, string | undefined> = {};\n\n for (const key in record) {\n if (key.startsWith(\"data-\")) {\n const value = record[key];\n attributes[key] = value == null ? undefined : String(value);\n }\n }\n\n return attributes as JSX.HTMLAttributes<HTMLDivElement>;\n}\n\nexport function Meter(props: MeterProps): JSX.Element {\n const contextProps = getSlottedContextProps(useContext(MeterContext), props.slot);\n const merged = mergeProps(contextProps ?? {}, props) as MeterProps & {\n class?: string;\n role?: string;\n style?: JSX.CSSProperties;\n showValueLabel?: boolean;\n children?: JSX.Element;\n };\n const [local] = splitProps(merged, [\n \"value\",\n \"minValue\",\n \"maxValue\",\n \"valueLabel\",\n \"formatOptions\",\n \"size\",\n \"segments\",\n \"variant\",\n \"label\",\n \"staticColor\",\n \"labelPosition\",\n \"styles\",\n \"UNSAFE_className\",\n \"UNSAFE_style\",\n \"slot\",\n \"ref\",\n \"id\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n \"class\",\n \"role\",\n \"style\",\n \"showValueLabel\",\n \"children\",\n ]);\n const labelId = createUniqueId();\n const size = () => local.size ?? \"M\";\n const variant = () => normalizeVariant(local.variant);\n const labelPosition = () => local.labelPosition ?? \"top\";\n const isStaticColor = () => !!local.staticColor;\n const state = (labelAlign?: \"start\" | \"end\"): MeterStyleState => ({\n size: size(),\n variant: variant(),\n staticColor: local.staticColor,\n labelPosition: labelPosition(),\n labelAlign,\n isStaticColor: isStaticColor(),\n isSegmented: segmentCount() != null,\n });\n const accessibleLabelledBy = () =>\n local[\"aria-labelledby\"] ?? (!local[\"aria-label\"] && local.label ? labelId : undefined);\n\n const meterAria = createMeter({\n get id() {\n return local.id;\n },\n get value() {\n return local.value;\n },\n get minValue() {\n return local.minValue;\n },\n get maxValue() {\n return local.maxValue;\n },\n get valueLabel() {\n return stringValueLabel(local.valueLabel);\n },\n get formatOptions() {\n return local.formatOptions;\n },\n get \"aria-label\"() {\n return local[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return accessibleLabelledBy();\n },\n get \"aria-describedby\"() {\n return local[\"aria-describedby\"];\n },\n get \"aria-details\"() {\n return local[\"aria-details\"];\n },\n });\n\n const percentage = createMemo(() => {\n const minValue = local.minValue ?? 0;\n const maxValue = local.maxValue ?? 100;\n const value = clamp(local.value ?? 0, minValue, maxValue);\n return ((value - minValue) / (maxValue - minValue)) * 100;\n });\n const valueText = () =>\n local.valueLabel ?? (meterAria.meterProps[\"aria-valuetext\"] as string | undefined);\n const segmentCount = () => {\n const segments = local.segments;\n return segments != null && Number.isFinite(segments) && segments >= 1\n ? Math.floor(segments)\n : null;\n };\n const filledCount = createMemo(() => {\n const segments = segmentCount();\n return segments == null\n ? 0\n : clamp(Math.round((percentage() / 100) * segments), 0, segments);\n });\n const showValue = () => !!local.label;\n const mergedStyles = () => mergeContextStyles(contextProps?.styles, props.styles);\n const mergedUnsafeStyle = () =>\n mergeContextUnsafeStyle(contextProps?.UNSAFE_style, props.UNSAFE_style);\n\n return (\n <div\n {...getDataAttributes(merged)}\n {...meterAria.meterProps}\n role=\"meter\"\n ref={mergeContextRefs(\n (contextProps as { ref?: RefLike<HTMLDivElement> } | null)?.ref,\n props.ref,\n )}\n class={[local.UNSAFE_className, wrapperStyles(state(), mergedStyles())]\n .filter(Boolean)\n .join(\" \")}\n style={mergedUnsafeStyle()}\n slot={local.slot ?? undefined}\n >\n {local.label && (\n <div class={labelWrapperStyles(state(\"start\"))}>\n <span id={labelId} class={labelStyles(state(\"start\"))}>\n {local.label}\n </span>\n </div>\n )}\n {showValue() && <Text styles={valueStyles(state(\"end\"))}>{valueText()}</Text>}\n <SkeletonWrapper>\n {segmentCount() != null ? (\n <div class={segmentRowStyles} aria-hidden=\"true\">\n <For each={Array.from({ length: segmentCount() ?? 0 })}>\n {(_, index) => (\n <div class={segmentStyles({ ...state(), isFilled: index() < filledCount() })} />\n )}\n </For>\n </div>\n ) : (\n <div class={trackStyles(state())}>\n <div class={fillStyles(state())} style={{ width: `${percentage()}%` }} />\n <div aria-hidden=\"true\" class={trackRimStyles} />\n </div>\n )}\n </SkeletonWrapper>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AA2CA,SAAS,iBAAiB,SAAwC;CAChE,QAAQ,SAAR;EACE,KAAK,WACH,OAAO;EACT,KAAK,WACH,OAAO;EACT,SACE,OAAO,WAAW;CACtB;AACF;AA+CA,MAAa,eAAe,cAAgD,IAAA;AAY5E,MAAM,gBAAA,SAAA,UAAA,OAAA,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCN,MAAM,qBAAA,SAAA,UAAA,OAAA;;;;;;;;;;;;;;AA6BN,MAAM,cAAA,SAAA,UAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIN,MAAM,cAAA,SAAA,UAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKN,MAAM,cAAA,SAAA,UAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DN,MAAM,aAAA,SAAA,UAAA,OAAA;;;;;;;;;;;;;;;;AAmCN,MAAM,gBAAA,SAAA,UAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BN,SAAS,MAAM,OAAe,KAAa,KAAoB;CAC7D,OAAO,KAAK,IAAI,KAAK,IAAI,OAAO,GAAA,GAAM,GAAA;AACxC;AAEA,SAAS,iBAAiB,OAAmD;CAC3E,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,UAChD,OAAO,OAAO,KAAA;AAGlB;AAEA,SAAS,kBAAkB,QAAoC;CAC7D,MAAM,SAAS;CACf,MAAM,aAAiD,CAAC;CAExD,KAAK,MAAM,OAAO,QAChB,IAAI,IAAI,WAAW,OAAA,GAAU;EAC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,YAAA;MAAc,CAAA,CAAA,CAAA;MAAA,OAAA;KAAA,GAAA;IAC5E,CAAA,CAAA;IAAA,OAAA;GAAA,GAAA,WAAA;IAAA,IAAA,SAAA,eAAA,OAAA,GAAA,SAAA,OAAA;IAAA,OAAA;IAAA,QAAA,QAAA;KAAA,IAAA,OAIQ,YAAY,MAAA,CAAA,GAAA,OACV,WAAW,MAAA,CAAA,GAAA,OAA0B,GAAG,WAAA,EAAA;KAAe,SAAA,IAAA,KAAA,UAAA,QAAA,IAAA,IAAA,IAAA;KAAA,SAAA,IAAA,KAAA,UAAA,QAAA,IAAA,IAAA,IAAA;KAAA,SAAA,IAAA,KAAA,iBAAA,QAAA,SAAA,IAAA,IAAA,IAAA;KAAA,OAAA;IAAA,GAAA;KAAA,GAAA,KAAA;KAAA,GAAA,KAAA;KAAA,GAAA,KAAA;IAAA,CAAA;IAAA,OAAA;GAAA,GAAA;EAGvE,EAAA,CAAA,GAAA,OAAA,KAAA;EAAA,mBAAA;EAAA,OAAA;CAAA,GAAA;AAIR"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/meter/index.tsx"],"sourcesContent":["import {\n type JSX,\n For,\n createContext,\n createMemo,\n createUniqueId,\n mergeProps,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport { createMeter } from \"@proyecto-viviana/solidaria\";\nimport { SkeletonWrapper } from \"../skeleton\";\nimport { Text } from \"../text\";\nimport type { StyleString } from \"../style\";\nimport { lightDark, style } from \"../style\" with { type: \"macro\" };\nimport type { UnsafeClassName } from \"../s2-internal/style-utils\";\nimport {\n centerPadding,\n controlSize,\n fieldInput,\n fieldLabel,\n fieldValue,\n getAllowedOverrides,\n staticColor as staticColorStyles,\n} from \"../s2-internal/style-utils\" with { type: \"macro\" };\nimport {\n getSlottedContextProps,\n mergeContextRefs,\n mergeContextStyles,\n mergeContextUnsafeStyle,\n type RefLike,\n type SpectrumContextValue,\n} from \"../button/spectrum-context\";\n\ntype MeterSize = \"S\" | \"M\" | \"L\" | \"XL\";\ntype MeterVariant = \"informative\" | \"positive\" | \"notice\" | \"negative\";\n/* `success` and `warning` are accepted alias names for `positive`/`notice` — the\n * negative/warning/success status trio Button and Badge also expose — folded onto\n * the canonical channel by normalizeVariant before styling. */\ntype MeterVariantProp = MeterVariant | \"success\" | \"warning\";\ntype MeterStaticColor = \"white\" | \"black\" | \"auto\";\ntype MeterLabelPosition = \"top\" | \"side\";\n\nfunction normalizeVariant(variant: MeterVariantProp | undefined): MeterVariant {\n switch (variant) {\n case \"success\":\n return \"positive\";\n case \"warning\":\n return \"notice\";\n default:\n return variant ?? \"informative\";\n }\n}\n\nexport interface MeterProps {\n /** The current value (controlled). @default 0 */\n value?: number;\n /** The smallest value allowed. @default 0 */\n minValue?: number;\n /** The largest value allowed. @default 100 */\n maxValue?: number;\n /** The content to display as the value's label (e.g. \"75 GB\"). */\n valueLabel?: JSX.Element;\n /** The display format of the value label. */\n formatOptions?: Intl.NumberFormatOptions;\n /** The size of the meter. @default 'M' */\n size?: MeterSize;\n /**\n * Render the meter as this many discrete blocks instead of a continuous bar —\n * the register's `[▮▮▮▯▯]` capacity form (Panel07's focus/streak/xp/memory\n * rows, TerminalGlassLab.tsx:914-931). The value quantizes to\n * `round(fraction × segments)` filled blocks; the accessible value stays\n * continuous.\n */\n segments?: number;\n /** The visual style variant. `success`/`warning` alias `positive`/`notice`. @default 'informative' */\n variant?: MeterVariantProp;\n /** The label to display above the meter. */\n label?: JSX.Element;\n /** The static color style to apply over a color background. */\n staticColor?: MeterStaticColor;\n /** The label's overall position relative to the meter. @default 'top' */\n labelPosition?: MeterLabelPosition;\n /** Spectrum-defined generated classes. */\n styles?: StyleString | (() => StyleString | undefined);\n /** Additional CSS class name. Use only as a last resort. */\n UNSAFE_className?: UnsafeClassName | string;\n /** Additional inline styles. Use only as a last resort. */\n UNSAFE_style?: JSX.CSSProperties;\n id?: string;\n slot?: string | null;\n ref?: RefLike<HTMLDivElement>;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n \"aria-describedby\"?: string;\n \"aria-details\"?: string;\n [key: `data-${string}`]: string | undefined;\n}\n\nexport const MeterContext = createContext<SpectrumContextValue<MeterProps>>(null);\n\ntype MeterStyleState = {\n size: MeterSize;\n variant: MeterVariant;\n staticColor?: MeterStaticColor;\n labelPosition: MeterLabelPosition;\n labelAlign?: \"start\" | \"end\";\n isStaticColor: boolean;\n isSegmented: boolean;\n};\n\nconst wrapperStyles = style<MeterStyleState>(\n {\n ...staticColorStyles(),\n position: \"relative\",\n display: \"grid\",\n gridTemplateColumns: {\n labelPosition: {\n top: [\"1fr\", \"auto\"],\n side: [\"auto\", \"1fr\"],\n },\n },\n gridTemplateAreas: {\n labelPosition: {\n top: [\"label value\", \"bar bar\"],\n side: [\"label bar value\"],\n },\n },\n alignItems: \"baseline\",\n isolation: \"isolate\",\n minWidth: 48,\n maxWidth: 768,\n \"--field-height\": {\n type: \"height\",\n value: controlSize(),\n },\n \"--track-to-label\": {\n type: \"height\",\n value: 4,\n },\n \"--field-gap\": {\n type: \"rowGap\",\n value: centerPadding(\"calc(var(--field-height) + var(--track-to-label))\"),\n },\n columnGap: 12,\n },\n getAllowedOverrides(),\n);\n\nconst labelWrapperStyles = style<MeterStyleState>({\n gridArea: \"label\",\n display: \"inline\",\n textAlign: {\n labelAlign: {\n start: \"start\",\n end: \"end\",\n },\n },\n paddingBottom: {\n labelPosition: {\n top: \"--field-gap\",\n },\n },\n contain: {\n labelPosition: {\n /* Size containment here relies on the bar row to size the grid — the\n * continuous track advertises a 208px intrinsic width (fieldInput's\n * containIntrinsicWidth). The segment row is content-sized (a handful of\n * 7px blocks), so with segments the label must contribute its own width\n * or the value overprints it. */\n top: {\n default: \"inline-size\",\n isSegmented: \"none\",\n },\n },\n },\n});\n\nconst labelStyles = style<MeterStyleState>({\n ...fieldLabel(),\n});\n\nconst valueStyles = style<MeterStyleState>({\n ...fieldValue(),\n gridArea: \"value\",\n});\n\nconst trackStyles = style<MeterStyleState>({\n ...fieldInput(),\n gridArea: \"bar\",\n /* Containing block for the rim overlay below. wrapperStyles above is already\n * `position: \"relative\"`, so without this the overlay's `inset: 0` would\n * resolve against the whole component and rim the label and value rows too.\n * `zIndex: 1` below is unaffected: it already applied without positioning\n * (the track is a grid item), and it keeps applying now. */\n position: \"relative\",\n overflow: \"hidden\",\n /* Square, matching ProgressBar's track. The register's bar primitive (the XP\n * bar in design-handoff-v2/TerminalGlassLab.tsx) declares no border-radius on\n * either the track or the fill, so both compute to 0. */\n borderRadius: \"none\",\n backgroundColor: {\n /* The register's recessed surface: the same `var(--surface-inset)` the\n * handoff's bar track paints, and the same one ProgressBar uses. */\n default: \"pasteboard\",\n isStaticColor: \"transparent-overlay-300\",\n forcedColors: \"ButtonFace\",\n },\n outlineWidth: {\n default: 0,\n forcedColors: 1,\n },\n outlineStyle: {\n default: \"none\",\n forcedColors: \"solid\",\n },\n outlineColor: {\n default: \"transparent\",\n forcedColors: \"ButtonText\",\n },\n zIndex: 1,\n height: {\n default: 6,\n size: {\n S: 4,\n M: 6,\n L: 8,\n XL: 10,\n },\n },\n});\n\n/* The rim goes on its own absolutely-positioned layer rather than on trackStyles,\n * which is how the handoff paints it too (design-handoff-v2/TerminalGlassLab.tsx\n * lays an `inset: 0` / `pointer-events: none` / `box-shadow: var(--edge-glass)`\n * div over the bar's fills). The reason it cannot live on the track: an inset\n * box-shadow is painted with the element's own background, beneath every in-flow\n * descendant. `overflow: hidden` clips the fill but does not lift the track's\n * inset shadow above it, so a rim declared on the track would be occluded across\n * the filled fraction and survive only on the empty remainder — a half-rim that\n * reads as a bug. Kept local rather than shared with ProgressBar: the two have no\n * common style module today and inventing one widens a two-site fix. */\nconst trackRimStyles = style({\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n borderRadius: \"inherit\",\n boxShadow: \"edge-glass\",\n});\n\nconst fillStyles = style<MeterStyleState>({\n height: \"full\",\n borderStyle: \"none\",\n borderRadius: \"none\",\n backgroundColor: {\n default: lightDark(\"informative-800\", \"informative-900\"),\n variant: {\n positive: lightDark(\"positive-800\", \"positive-900\"),\n notice: lightDark(\"notice-800\", \"notice-900\"),\n negative: lightDark(\"negative-800\", \"negative-900\"),\n },\n isStaticColor: \"transparent-overlay-900\",\n forcedColors: \"ButtonText\",\n },\n});\n\n/* The discrete form. The register draws it as literal ▮/▯ glyphs in mono text\n * (TerminalGlassLab.tsx:918: `[▮▮▮▯▯] 3/5`); as a library primitive the blocks\n * are drawn divs at the glyph's box (7×12 — U+25AE's ink at the wells' 11.5px\n * mono), because a glyph's rendered size shifts with the consumer's font stack.\n * Filled and empty share one ink — the glyph pair differs only in fill, and the\n * register keeps channel color OFF the blocks (it lives on the row label). Here\n * the ink follows the variant so the meter still reads outside a well. No rim:\n * the blocks are marks, not a recessed surface. */\n/* Static (no conditions), so the macro yields a string used directly as a\n * class — same pattern as trackRimStyles above. */\nconst segmentRowStyles = style({\n gridArea: \"bar\",\n display: \"flex\",\n alignItems: \"center\",\n columnGap: \"[3px]\",\n});\n\ntype MeterSegmentStyleState = MeterStyleState & { isFilled: boolean };\n\nconst segmentStyles = style<MeterSegmentStyleState>({\n width: 7,\n height: 12,\n boxSizing: \"border-box\",\n borderStyle: \"solid\",\n borderWidth: 1,\n borderColor: {\n default: lightDark(\"informative-800\", \"informative-900\"),\n variant: {\n positive: lightDark(\"positive-800\", \"positive-900\"),\n notice: lightDark(\"notice-800\", \"notice-900\"),\n negative: lightDark(\"negative-800\", \"negative-900\"),\n },\n isStaticColor: \"transparent-overlay-900\",\n forcedColors: \"ButtonText\",\n },\n backgroundColor: {\n default: \"transparent\",\n isFilled: {\n default: lightDark(\"informative-800\", \"informative-900\"),\n variant: {\n positive: lightDark(\"positive-800\", \"positive-900\"),\n notice: lightDark(\"notice-800\", \"notice-900\"),\n negative: lightDark(\"negative-800\", \"negative-900\"),\n },\n isStaticColor: \"transparent-overlay-900\",\n forcedColors: \"ButtonText\",\n },\n },\n});\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\nfunction stringValueLabel(value: JSX.Element | undefined): string | undefined {\n if (typeof value === \"string\" || typeof value === \"number\") {\n return String(value);\n }\n return undefined;\n}\n\nfunction getDataAttributes(source: object): JSX.HTMLAttributes<HTMLDivElement> {\n const record = source as Record<string, unknown>;\n const attributes: Record<string, string | undefined> = {};\n\n for (const key in record) {\n if (key.startsWith(\"data-\")) {\n const value = record[key];\n attributes[key] = value == null ? undefined : String(value);\n }\n }\n\n return attributes as JSX.HTMLAttributes<HTMLDivElement>;\n}\n\nexport function Meter(props: MeterProps): JSX.Element {\n const contextProps = getSlottedContextProps(useContext(MeterContext), props.slot);\n const merged = mergeProps(contextProps ?? {}, props) as MeterProps & {\n class?: string;\n role?: string;\n style?: JSX.CSSProperties;\n showValueLabel?: boolean;\n children?: JSX.Element;\n };\n const [local] = splitProps(merged, [\n \"value\",\n \"minValue\",\n \"maxValue\",\n \"valueLabel\",\n \"formatOptions\",\n \"size\",\n \"segments\",\n \"variant\",\n \"label\",\n \"staticColor\",\n \"labelPosition\",\n \"styles\",\n \"UNSAFE_className\",\n \"UNSAFE_style\",\n \"slot\",\n \"ref\",\n \"id\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n \"class\",\n \"role\",\n \"style\",\n \"showValueLabel\",\n \"children\",\n ]);\n const labelId = createUniqueId();\n const size = () => local.size ?? \"M\";\n const variant = () => normalizeVariant(local.variant);\n const labelPosition = () => local.labelPosition ?? \"top\";\n const isStaticColor = () => !!local.staticColor;\n const state = (labelAlign?: \"start\" | \"end\"): MeterStyleState => ({\n size: size(),\n variant: variant(),\n staticColor: local.staticColor,\n labelPosition: labelPosition(),\n labelAlign,\n isStaticColor: isStaticColor(),\n isSegmented: segmentCount() != null,\n });\n const accessibleLabelledBy = () =>\n local[\"aria-labelledby\"] ?? (!local[\"aria-label\"] && local.label ? labelId : undefined);\n\n const meterAria = createMeter({\n get id() {\n return local.id;\n },\n get value() {\n return local.value;\n },\n get minValue() {\n return local.minValue;\n },\n get maxValue() {\n return local.maxValue;\n },\n get valueLabel() {\n return stringValueLabel(local.valueLabel);\n },\n get formatOptions() {\n return local.formatOptions;\n },\n get \"aria-label\"() {\n return local[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return accessibleLabelledBy();\n },\n get \"aria-describedby\"() {\n return local[\"aria-describedby\"];\n },\n get \"aria-details\"() {\n return local[\"aria-details\"];\n },\n });\n\n const percentage = createMemo(() => {\n const minValue = local.minValue ?? 0;\n const maxValue = local.maxValue ?? 100;\n const value = clamp(local.value ?? 0, minValue, maxValue);\n return ((value - minValue) / (maxValue - minValue)) * 100;\n });\n const valueText = () =>\n local.valueLabel ?? (meterAria.meterProps[\"aria-valuetext\"] as string | undefined);\n const segmentCount = () => {\n const segments = local.segments;\n return segments != null && Number.isFinite(segments) && segments >= 1\n ? Math.floor(segments)\n : null;\n };\n const filledCount = createMemo(() => {\n const segments = segmentCount();\n return segments == null ? 0 : clamp(Math.round((percentage() / 100) * segments), 0, segments);\n });\n const showValue = () => !!local.label;\n const mergedStyles = () => mergeContextStyles(contextProps?.styles, props.styles);\n const mergedUnsafeStyle = () =>\n mergeContextUnsafeStyle(contextProps?.UNSAFE_style, props.UNSAFE_style);\n\n return (\n <div\n {...getDataAttributes(merged)}\n {...meterAria.meterProps}\n role=\"meter\"\n ref={mergeContextRefs(\n (contextProps as { ref?: RefLike<HTMLDivElement> } | null)?.ref,\n props.ref,\n )}\n class={[local.UNSAFE_className, wrapperStyles(state(), mergedStyles())]\n .filter(Boolean)\n .join(\" \")}\n style={mergedUnsafeStyle()}\n slot={local.slot ?? undefined}\n >\n {local.label && (\n <div class={labelWrapperStyles(state(\"start\"))}>\n <span id={labelId} class={labelStyles(state(\"start\"))}>\n {local.label}\n </span>\n </div>\n )}\n {showValue() && <Text styles={valueStyles(state(\"end\"))}>{valueText()}</Text>}\n <SkeletonWrapper>\n {segmentCount() != null ? (\n <div class={segmentRowStyles} aria-hidden=\"true\">\n <For each={Array.from({ length: segmentCount() ?? 0 })}>\n {(_, index) => (\n <div class={segmentStyles({ ...state(), isFilled: index() < filledCount() })} />\n )}\n </For>\n </div>\n ) : (\n <div class={trackStyles(state())}>\n <div class={fillStyles(state())} style={{ width: `${percentage()}%` }} />\n <div aria-hidden=\"true\" class={trackRimStyles} />\n </div>\n )}\n </SkeletonWrapper>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AA2CA,SAAS,iBAAiB,SAAwC;CAChE,QAAQ,SAAR;EACE,KAAK,WACH,OAAO;EACT,KAAK,WACH,OAAO;EACT,SACE,OAAO,WAAW;CACtB;AACF;AA+CA,MAAa,eAAe,cAAgD,IAAA;AAY5E,MAAM,gBAAA,SAAA,UAAA,OAAA,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCN,MAAM,qBAAA,SAAA,UAAA,OAAA;;;;;;;;;;;;;;AA6BN,MAAM,cAAA,SAAA,UAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIN,MAAM,cAAA,SAAA,UAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKN,MAAM,cAAA,SAAA,UAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DN,MAAM,aAAA,SAAA,UAAA,OAAA;;;;;;;;;;;;;;;;AAmCN,MAAM,gBAAA,SAAA,UAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BN,SAAS,MAAM,OAAe,KAAa,KAAoB;CAC7D,OAAO,KAAK,IAAI,KAAK,IAAI,OAAO,GAAA,GAAM,GAAA;AACxC;AAEA,SAAS,iBAAiB,OAAmD;CAC3E,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,UAChD,OAAO,OAAO,KAAA;AAGlB;AAEA,SAAS,kBAAkB,QAAoC;CAC7D,M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MAAA,IAAA,QAAA,eAAA,OAAA;MAAA,aAAA,UAAA,OACS,cAAc;OAAE,GAAG,MAAA;OAAS,UAAU,MAAA,IAAU,YAAA;MAAc,CAAA,CAAA,CAAA;MAAA,OAAA;KAAA,GAAA;IAC5E,CAAA,CAAA;IAAA,OAAA;GAAA,GAAA,WAAA;IAAA,IAAA,SAAA,eAAA,OAAA,GAAA,SAAA,OAAA;IAAA,OAAA;IAAA,QAAA,QAAA;KAAA,IAAA,OAIQ,YAAY,MAAA,CAAA,GAAA,OACV,WAAW,MAAA,CAAA,GAAA,OAA0B,GAAG,WAAA,EAAA;KAAe,SAAA,IAAA,KAAA,UAAA,QAAA,IAAA,IAAA,IAAA;KAAA,SAAA,IAAA,KAAA,UAAA,QAAA,IAAA,IAAA,IAAA;KAAA,SAAA,IAAA,KAAA,iBAAA,QAAA,SAAA,IAAA,IAAA,IAAA;KAAA,OAAA;IAAA,GAAA;KAAA,GAAA,KAAA;KAAA,GAAA,KAAA;KAAA,GAAA,KAAA;IAAA,CAAA;IAAA,OAAA;GAAA,GAAA;EAGvE,EAAA,CAAA,GAAA,OAAA,KAAA;EAAA,mBAAA;EAAA,OAAA;CAAA,GAAA;AAIR"}
|
package/dist/meter/index.jsx
CHANGED
|
@@ -113,7 +113,7 @@ const labelStyles = function anonymous(props) {
|
|
|
113
113
|
}
|
|
114
114
|
if (props.isStaticColor) rules += " pl151";
|
|
115
115
|
else if (props.isDisabled) rules += " pUvnvv151";
|
|
116
|
-
else rules += "
|
|
116
|
+
else rules += " pWQ7V3d151";
|
|
117
117
|
rules += " plb151";
|
|
118
118
|
rules += " ri151";
|
|
119
119
|
return rules;
|
|
@@ -157,7 +157,7 @@ const valueStyles = function anonymous(props) {
|
|
|
157
157
|
}
|
|
158
158
|
if (props.isStaticColor) rules += " pl151";
|
|
159
159
|
else if (props.isDisabled) rules += " pUvnvv151";
|
|
160
|
-
else rules += "
|
|
160
|
+
else rules += " pWQ7V3d151";
|
|
161
161
|
rules += " plb151";
|
|
162
162
|
rules += " ri151";
|
|
163
163
|
rules += " z8bmXs151";
|
package/dist/meter/index.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.jsx","names":[],"sources":["../../src/meter/index.tsx"],"sourcesContent":["import {\n type JSX,\n For,\n createContext,\n createMemo,\n createUniqueId,\n mergeProps,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport { createMeter } from \"@proyecto-viviana/solidaria\";\nimport { SkeletonWrapper } from \"../skeleton\";\nimport { Text } from \"../text\";\nimport type { StyleString } from \"../style\";\nimport { lightDark, style } from \"../style\" with { type: \"macro\" };\nimport type { UnsafeClassName } from \"../s2-internal/style-utils\";\nimport {\n centerPadding,\n controlSize,\n fieldInput,\n fieldLabel,\n fieldValue,\n getAllowedOverrides,\n staticColor as staticColorStyles,\n} from \"../s2-internal/style-utils\" with { type: \"macro\" };\nimport {\n getSlottedContextProps,\n mergeContextRefs,\n mergeContextStyles,\n mergeContextUnsafeStyle,\n type RefLike,\n type SpectrumContextValue,\n} from \"../button/spectrum-context\";\n\ntype MeterSize = \"S\" | \"M\" | \"L\" | \"XL\";\ntype MeterVariant = \"informative\" | \"positive\" | \"notice\" | \"negative\";\n/* `success` and `warning` are accepted alias names for `positive`/`notice` — the\n * negative/warning/success status trio Button and Badge also expose — folded onto\n * the canonical channel by normalizeVariant before styling. */\ntype MeterVariantProp = MeterVariant | \"success\" | \"warning\";\ntype MeterStaticColor = \"white\" | \"black\" | \"auto\";\ntype MeterLabelPosition = \"top\" | \"side\";\n\nfunction normalizeVariant(variant: MeterVariantProp | undefined): MeterVariant {\n switch (variant) {\n case \"success\":\n return \"positive\";\n case \"warning\":\n return \"notice\";\n default:\n return variant ?? \"informative\";\n }\n}\n\nexport interface MeterProps {\n /** The current value (controlled). @default 0 */\n value?: number;\n /** The smallest value allowed. @default 0 */\n minValue?: number;\n /** The largest value allowed. @default 100 */\n maxValue?: number;\n /** The content to display as the value's label (e.g. \"75 GB\"). */\n valueLabel?: JSX.Element;\n /** The display format of the value label. */\n formatOptions?: Intl.NumberFormatOptions;\n /** The size of the meter. @default 'M' */\n size?: MeterSize;\n /**\n * Render the meter as this many discrete blocks instead of a continuous bar —\n * the register's `[▮▮▮▯▯]` capacity form (Panel07's focus/streak/xp/memory\n * rows, TerminalGlassLab.tsx:914-931). The value quantizes to\n * `round(fraction × segments)` filled blocks; the accessible value stays\n * continuous.\n */\n segments?: number;\n /** The visual style variant. `success`/`warning` alias `positive`/`notice`. @default 'informative' */\n variant?: MeterVariantProp;\n /** The label to display above the meter. */\n label?: JSX.Element;\n /** The static color style to apply over a color background. */\n staticColor?: MeterStaticColor;\n /** The label's overall position relative to the meter. @default 'top' */\n labelPosition?: MeterLabelPosition;\n /** Spectrum-defined generated classes. */\n styles?: StyleString | (() => StyleString | undefined);\n /** Additional CSS class name. Use only as a last resort. */\n UNSAFE_className?: UnsafeClassName | string;\n /** Additional inline styles. Use only as a last resort. */\n UNSAFE_style?: JSX.CSSProperties;\n id?: string;\n slot?: string | null;\n ref?: RefLike<HTMLDivElement>;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n \"aria-describedby\"?: string;\n \"aria-details\"?: string;\n [key: `data-${string}`]: string | undefined;\n}\n\nexport const MeterContext = createContext<SpectrumContextValue<MeterProps>>(null);\n\ntype MeterStyleState = {\n size: MeterSize;\n variant: MeterVariant;\n staticColor?: MeterStaticColor;\n labelPosition: MeterLabelPosition;\n labelAlign?: \"start\" | \"end\";\n isStaticColor: boolean;\n isSegmented: boolean;\n};\n\nconst wrapperStyles = style<MeterStyleState>(\n {\n ...staticColorStyles(),\n position: \"relative\",\n display: \"grid\",\n gridTemplateColumns: {\n labelPosition: {\n top: [\"1fr\", \"auto\"],\n side: [\"auto\", \"1fr\"],\n },\n },\n gridTemplateAreas: {\n labelPosition: {\n top: [\"label value\", \"bar bar\"],\n side: [\"label bar value\"],\n },\n },\n alignItems: \"baseline\",\n isolation: \"isolate\",\n minWidth: 48,\n maxWidth: 768,\n \"--field-height\": {\n type: \"height\",\n value: controlSize(),\n },\n \"--track-to-label\": {\n type: \"height\",\n value: 4,\n },\n \"--field-gap\": {\n type: \"rowGap\",\n value: centerPadding(\"calc(var(--field-height) + var(--track-to-label))\"),\n },\n columnGap: 12,\n },\n getAllowedOverrides(),\n);\n\nconst labelWrapperStyles = style<MeterStyleState>({\n gridArea: \"label\",\n display: \"inline\",\n textAlign: {\n labelAlign: {\n start: \"start\",\n end: \"end\",\n },\n },\n paddingBottom: {\n labelPosition: {\n top: \"--field-gap\",\n },\n },\n contain: {\n labelPosition: {\n /* Size containment here relies on the bar row to size the grid — the\n * continuous track advertises a 208px intrinsic width (fieldInput's\n * containIntrinsicWidth). The segment row is content-sized (a handful of\n * 7px blocks), so with segments the label must contribute its own width\n * or the value overprints it. */\n top: {\n default: \"inline-size\",\n isSegmented: \"none\",\n },\n },\n },\n});\n\nconst labelStyles = style<MeterStyleState>({\n ...fieldLabel(),\n});\n\nconst valueStyles = style<MeterStyleState>({\n ...fieldValue(),\n gridArea: \"value\",\n});\n\nconst trackStyles = style<MeterStyleState>({\n ...fieldInput(),\n gridArea: \"bar\",\n /* Containing block for the rim overlay below. wrapperStyles above is already\n * `position: \"relative\"`, so without this the overlay's `inset: 0` would\n * resolve against the whole component and rim the label and value rows too.\n * `zIndex: 1` below is unaffected: it already applied without positioning\n * (the track is a grid item), and it keeps applying now. */\n position: \"relative\",\n overflow: \"hidden\",\n /* Square, matching ProgressBar's track. The register's bar primitive (the XP\n * bar in design-handoff-v2/TerminalGlassLab.tsx) declares no border-radius on\n * either the track or the fill, so both compute to 0. */\n borderRadius: \"none\",\n backgroundColor: {\n /* The register's recessed surface: the same `var(--surface-inset)` the\n * handoff's bar track paints, and the same one ProgressBar uses. */\n default: \"pasteboard\",\n isStaticColor: \"transparent-overlay-300\",\n forcedColors: \"ButtonFace\",\n },\n outlineWidth: {\n default: 0,\n forcedColors: 1,\n },\n outlineStyle: {\n default: \"none\",\n forcedColors: \"solid\",\n },\n outlineColor: {\n default: \"transparent\",\n forcedColors: \"ButtonText\",\n },\n zIndex: 1,\n height: {\n default: 6,\n size: {\n S: 4,\n M: 6,\n L: 8,\n XL: 10,\n },\n },\n});\n\n/* The rim goes on its own absolutely-positioned layer rather than on trackStyles,\n * which is how the handoff paints it too (design-handoff-v2/TerminalGlassLab.tsx\n * lays an `inset: 0` / `pointer-events: none` / `box-shadow: var(--edge-glass)`\n * div over the bar's fills). The reason it cannot live on the track: an inset\n * box-shadow is painted with the element's own background, beneath every in-flow\n * descendant. `overflow: hidden` clips the fill but does not lift the track's\n * inset shadow above it, so a rim declared on the track would be occluded across\n * the filled fraction and survive only on the empty remainder — a half-rim that\n * reads as a bug. Kept local rather than shared with ProgressBar: the two have no\n * common style module today and inventing one widens a two-site fix. */\nconst trackRimStyles = style({\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n borderRadius: \"inherit\",\n boxShadow: \"edge-glass\",\n});\n\nconst fillStyles = style<MeterStyleState>({\n height: \"full\",\n borderStyle: \"none\",\n borderRadius: \"none\",\n backgroundColor: {\n default: lightDark(\"informative-800\", \"informative-900\"),\n variant: {\n positive: lightDark(\"positive-800\", \"positive-900\"),\n notice: lightDark(\"notice-800\", \"notice-900\"),\n negative: lightDark(\"negative-800\", \"negative-900\"),\n },\n isStaticColor: \"transparent-overlay-900\",\n forcedColors: \"ButtonText\",\n },\n});\n\n/* The discrete form. The register draws it as literal ▮/▯ glyphs in mono text\n * (TerminalGlassLab.tsx:918: `[▮▮▮▯▯] 3/5`); as a library primitive the blocks\n * are drawn divs at the glyph's box (7×12 — U+25AE's ink at the wells' 11.5px\n * mono), because a glyph's rendered size shifts with the consumer's font stack.\n * Filled and empty share one ink — the glyph pair differs only in fill, and the\n * register keeps channel color OFF the blocks (it lives on the row label). Here\n * the ink follows the variant so the meter still reads outside a well. No rim:\n * the blocks are marks, not a recessed surface. */\n/* Static (no conditions), so the macro yields a string used directly as a\n * class — same pattern as trackRimStyles above. */\nconst segmentRowStyles = style({\n gridArea: \"bar\",\n display: \"flex\",\n alignItems: \"center\",\n columnGap: \"[3px]\",\n});\n\ntype MeterSegmentStyleState = MeterStyleState & { isFilled: boolean };\n\nconst segmentStyles = style<MeterSegmentStyleState>({\n width: 7,\n height: 12,\n boxSizing: \"border-box\",\n borderStyle: \"solid\",\n borderWidth: 1,\n borderColor: {\n default: lightDark(\"informative-800\", \"informative-900\"),\n variant: {\n positive: lightDark(\"positive-800\", \"positive-900\"),\n notice: lightDark(\"notice-800\", \"notice-900\"),\n negative: lightDark(\"negative-800\", \"negative-900\"),\n },\n isStaticColor: \"transparent-overlay-900\",\n forcedColors: \"ButtonText\",\n },\n backgroundColor: {\n default: \"transparent\",\n isFilled: {\n default: lightDark(\"informative-800\", \"informative-900\"),\n variant: {\n positive: lightDark(\"positive-800\", \"positive-900\"),\n notice: lightDark(\"notice-800\", \"notice-900\"),\n negative: lightDark(\"negative-800\", \"negative-900\"),\n },\n isStaticColor: \"transparent-overlay-900\",\n forcedColors: \"ButtonText\",\n },\n },\n});\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\nfunction stringValueLabel(value: JSX.Element | undefined): string | undefined {\n if (typeof value === \"string\" || typeof value === \"number\") {\n return String(value);\n }\n return undefined;\n}\n\nfunction getDataAttributes(source: object): JSX.HTMLAttributes<HTMLDivElement> {\n const record = source as Record<string, unknown>;\n const attributes: Record<string, string | undefined> = {};\n\n for (const key in record) {\n if (key.startsWith(\"data-\")) {\n const value = record[key];\n attributes[key] = value == null ? undefined : String(value);\n }\n }\n\n return attributes as JSX.HTMLAttributes<HTMLDivElement>;\n}\n\nexport function Meter(props: MeterProps): JSX.Element {\n const contextProps = getSlottedContextProps(useContext(MeterContext), props.slot);\n const merged = mergeProps(contextProps ?? {}, props) as MeterProps & {\n class?: string;\n role?: string;\n style?: JSX.CSSProperties;\n showValueLabel?: boolean;\n children?: JSX.Element;\n };\n const [local] = splitProps(merged, [\n \"value\",\n \"minValue\",\n \"maxValue\",\n \"valueLabel\",\n \"formatOptions\",\n \"size\",\n \"segments\",\n \"variant\",\n \"label\",\n \"staticColor\",\n \"labelPosition\",\n \"styles\",\n \"UNSAFE_className\",\n \"UNSAFE_style\",\n \"slot\",\n \"ref\",\n \"id\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n \"class\",\n \"role\",\n \"style\",\n \"showValueLabel\",\n \"children\",\n ]);\n const labelId = createUniqueId();\n const size = () => local.size ?? \"M\";\n const variant = () => normalizeVariant(local.variant);\n const labelPosition = () => local.labelPosition ?? \"top\";\n const isStaticColor = () => !!local.staticColor;\n const state = (labelAlign?: \"start\" | \"end\"): MeterStyleState => ({\n size: size(),\n variant: variant(),\n staticColor: local.staticColor,\n labelPosition: labelPosition(),\n labelAlign,\n isStaticColor: isStaticColor(),\n isSegmented: segmentCount() != null,\n });\n const accessibleLabelledBy = () =>\n local[\"aria-labelledby\"] ?? (!local[\"aria-label\"] && local.label ? labelId : undefined);\n\n const meterAria = createMeter({\n get id() {\n return local.id;\n },\n get value() {\n return local.value;\n },\n get minValue() {\n return local.minValue;\n },\n get maxValue() {\n return local.maxValue;\n },\n get valueLabel() {\n return stringValueLabel(local.valueLabel);\n },\n get formatOptions() {\n return local.formatOptions;\n },\n get \"aria-label\"() {\n return local[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return accessibleLabelledBy();\n },\n get \"aria-describedby\"() {\n return local[\"aria-describedby\"];\n },\n get \"aria-details\"() {\n return local[\"aria-details\"];\n },\n });\n\n const percentage = createMemo(() => {\n const minValue = local.minValue ?? 0;\n const maxValue = local.maxValue ?? 100;\n const value = clamp(local.value ?? 0, minValue, maxValue);\n return ((value - minValue) / (maxValue - minValue)) * 100;\n });\n const valueText = () =>\n local.valueLabel ?? (meterAria.meterProps[\"aria-valuetext\"] as string | undefined);\n const segmentCount = () => {\n const segments = local.segments;\n return segments != null && Number.isFinite(segments) && segments >= 1\n ? Math.floor(segments)\n : null;\n };\n const filledCount = createMemo(() => {\n const segments = segmentCount();\n return segments == null\n ? 0\n : clamp(Math.round((percentage() / 100) * segments), 0, segments);\n });\n const showValue = () => !!local.label;\n const mergedStyles = () => mergeContextStyles(contextProps?.styles, props.styles);\n const mergedUnsafeStyle = () =>\n mergeContextUnsafeStyle(contextProps?.UNSAFE_style, props.UNSAFE_style);\n\n return (\n <div\n {...getDataAttributes(merged)}\n {...meterAria.meterProps}\n role=\"meter\"\n ref={mergeContextRefs(\n (contextProps as { ref?: RefLike<HTMLDivElement> } | null)?.ref,\n props.ref,\n )}\n class={[local.UNSAFE_className, wrapperStyles(state(), mergedStyles())]\n .filter(Boolean)\n .join(\" \")}\n style={mergedUnsafeStyle()}\n slot={local.slot ?? undefined}\n >\n {local.label && (\n <div class={labelWrapperStyles(state(\"start\"))}>\n <span id={labelId} class={labelStyles(state(\"start\"))}>\n {local.label}\n </span>\n </div>\n )}\n {showValue() && <Text styles={valueStyles(state(\"end\"))}>{valueText()}</Text>}\n <SkeletonWrapper>\n {segmentCount() != null ? (\n <div class={segmentRowStyles} aria-hidden=\"true\">\n <For each={Array.from({ length: segmentCount() ?? 0 })}>\n {(_, index) => (\n <div class={segmentStyles({ ...state(), isFilled: index() < filledCount() })} />\n )}\n </For>\n </div>\n ) : (\n <div class={trackStyles(state())}>\n <div class={fillStyles(state())} style={{ width: `${percentage()}%` }} />\n <div aria-hidden=\"true\" class={trackRimStyles} />\n </div>\n )}\n </SkeletonWrapper>\n </div>\n );\n}\n"],"mappings":";;;;;;AAcA,SAAS,iBAAiB,SAAwC;CAClE,QAAW,SAAX;EACO,KAAA,WACL,OAAa;EACb,KAAW,WACD,OAAA;EACV,SACU,OAAA,WAAA;CACV;AACF;AA+BA,MAAO,eAAqB,cAAA,IAAA;AAU5B,MAAE,gBAAoB,SAAC,UAAA,OAAmB,WAAA;CACtC,IAAE,QAAS;CACb,IAAM,WAAU;CACd,IAAA,WAAA;CACA,IAA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EACJ;EACI;EACA;EACA;EACJ;;EAEI;EACH;EACG;CACJ,CAAC;CACD,MAAM,UAAO,eAAA;CACb,MAAM,aAAC,MAAgB,QAAA;CACvB,MAAK,gBAAe,iBAAiB,MAAA,OAAA;CACrC,MAAI,sBAAS,MAAA,iBAAA;CACb,MAAG,sBAAA,CAAA,CAAA,MAAA;CACH,MAAE,SAAa,gBAA0C;EACpD,MAAO,KAAO;EACd,SAAS,QAAA;EACN,aAAC,MAAkB;EACnB,eAAc,cAAS;EAC/B;EACQ,eAAU,cAAA;EACV,aAAQ,aAAkB,KAAC;CAC/B;CACJ,MAAM,6BAAc,MAAA,uBAAA,CAAA,MAAA,iBAAA,MAAA,QAAA,UAAA,KAAA;CACpB,MAAM,YAAM,YAAA;EACR,IAAE,KAAG;GACN,OAAA,MAAA;EACA;EACA,IAAA,QAAA;GACE,OAAA,MAAgB;EACjB;EACA,IAAI,WAAW;GACX,OAAO,MAAM;EACjB;EACA,IAAI,WAAG;GACH,OAAK,MAAA;EACT;EACA,IAAI,aAAA;GACD,OAAI,iBAAmB,MAAQ,UAAC;EACnC;EACA,IAAI,gBAAiB;GACjB,OAAG,MAAA;EACP;EACA,IAAA,eAAe;GACd,OAAA,MAAA;EACN;EACH,IAAA,oBAAA"}
|
|
1
|
+
{"version":3,"file":"index.jsx","names":[],"sources":["../../src/meter/index.tsx"],"sourcesContent":["import {\n type JSX,\n For,\n createContext,\n createMemo,\n createUniqueId,\n mergeProps,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport { createMeter } from \"@proyecto-viviana/solidaria\";\nimport { SkeletonWrapper } from \"../skeleton\";\nimport { Text } from \"../text\";\nimport type { StyleString } from \"../style\";\nimport { lightDark, style } from \"../style\" with { type: \"macro\" };\nimport type { UnsafeClassName } from \"../s2-internal/style-utils\";\nimport {\n centerPadding,\n controlSize,\n fieldInput,\n fieldLabel,\n fieldValue,\n getAllowedOverrides,\n staticColor as staticColorStyles,\n} from \"../s2-internal/style-utils\" with { type: \"macro\" };\nimport {\n getSlottedContextProps,\n mergeContextRefs,\n mergeContextStyles,\n mergeContextUnsafeStyle,\n type RefLike,\n type SpectrumContextValue,\n} from \"../button/spectrum-context\";\n\ntype MeterSize = \"S\" | \"M\" | \"L\" | \"XL\";\ntype MeterVariant = \"informative\" | \"positive\" | \"notice\" | \"negative\";\n/* `success` and `warning` are accepted alias names for `positive`/`notice` — the\n * negative/warning/success status trio Button and Badge also expose — folded onto\n * the canonical channel by normalizeVariant before styling. */\ntype MeterVariantProp = MeterVariant | \"success\" | \"warning\";\ntype MeterStaticColor = \"white\" | \"black\" | \"auto\";\ntype MeterLabelPosition = \"top\" | \"side\";\n\nfunction normalizeVariant(variant: MeterVariantProp | undefined): MeterVariant {\n switch (variant) {\n case \"success\":\n return \"positive\";\n case \"warning\":\n return \"notice\";\n default:\n return variant ?? \"informative\";\n }\n}\n\nexport interface MeterProps {\n /** The current value (controlled). @default 0 */\n value?: number;\n /** The smallest value allowed. @default 0 */\n minValue?: number;\n /** The largest value allowed. @default 100 */\n maxValue?: number;\n /** The content to display as the value's label (e.g. \"75 GB\"). */\n valueLabel?: JSX.Element;\n /** The display format of the value label. */\n formatOptions?: Intl.NumberFormatOptions;\n /** The size of the meter. @default 'M' */\n size?: MeterSize;\n /**\n * Render the meter as this many discrete blocks instead of a continuous bar —\n * the register's `[▮▮▮▯▯]` capacity form (Panel07's focus/streak/xp/memory\n * rows, TerminalGlassLab.tsx:914-931). The value quantizes to\n * `round(fraction × segments)` filled blocks; the accessible value stays\n * continuous.\n */\n segments?: number;\n /** The visual style variant. `success`/`warning` alias `positive`/`notice`. @default 'informative' */\n variant?: MeterVariantProp;\n /** The label to display above the meter. */\n label?: JSX.Element;\n /** The static color style to apply over a color background. */\n staticColor?: MeterStaticColor;\n /** The label's overall position relative to the meter. @default 'top' */\n labelPosition?: MeterLabelPosition;\n /** Spectrum-defined generated classes. */\n styles?: StyleString | (() => StyleString | undefined);\n /** Additional CSS class name. Use only as a last resort. */\n UNSAFE_className?: UnsafeClassName | string;\n /** Additional inline styles. Use only as a last resort. */\n UNSAFE_style?: JSX.CSSProperties;\n id?: string;\n slot?: string | null;\n ref?: RefLike<HTMLDivElement>;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n \"aria-describedby\"?: string;\n \"aria-details\"?: string;\n [key: `data-${string}`]: string | undefined;\n}\n\nexport const MeterContext = createContext<SpectrumContextValue<MeterProps>>(null);\n\ntype MeterStyleState = {\n size: MeterSize;\n variant: MeterVariant;\n staticColor?: MeterStaticColor;\n labelPosition: MeterLabelPosition;\n labelAlign?: \"start\" | \"end\";\n isStaticColor: boolean;\n isSegmented: boolean;\n};\n\nconst wrapperStyles = style<MeterStyleState>(\n {\n ...staticColorStyles(),\n position: \"relative\",\n display: \"grid\",\n gridTemplateColumns: {\n labelPosition: {\n top: [\"1fr\", \"auto\"],\n side: [\"auto\", \"1fr\"],\n },\n },\n gridTemplateAreas: {\n labelPosition: {\n top: [\"label value\", \"bar bar\"],\n side: [\"label bar value\"],\n },\n },\n alignItems: \"baseline\",\n isolation: \"isolate\",\n minWidth: 48,\n maxWidth: 768,\n \"--field-height\": {\n type: \"height\",\n value: controlSize(),\n },\n \"--track-to-label\": {\n type: \"height\",\n value: 4,\n },\n \"--field-gap\": {\n type: \"rowGap\",\n value: centerPadding(\"calc(var(--field-height) + var(--track-to-label))\"),\n },\n columnGap: 12,\n },\n getAllowedOverrides(),\n);\n\nconst labelWrapperStyles = style<MeterStyleState>({\n gridArea: \"label\",\n display: \"inline\",\n textAlign: {\n labelAlign: {\n start: \"start\",\n end: \"end\",\n },\n },\n paddingBottom: {\n labelPosition: {\n top: \"--field-gap\",\n },\n },\n contain: {\n labelPosition: {\n /* Size containment here relies on the bar row to size the grid — the\n * continuous track advertises a 208px intrinsic width (fieldInput's\n * containIntrinsicWidth). The segment row is content-sized (a handful of\n * 7px blocks), so with segments the label must contribute its own width\n * or the value overprints it. */\n top: {\n default: \"inline-size\",\n isSegmented: \"none\",\n },\n },\n },\n});\n\nconst labelStyles = style<MeterStyleState>({\n ...fieldLabel(),\n});\n\nconst valueStyles = style<MeterStyleState>({\n ...fieldValue(),\n gridArea: \"value\",\n});\n\nconst trackStyles = style<MeterStyleState>({\n ...fieldInput(),\n gridArea: \"bar\",\n /* Containing block for the rim overlay below. wrapperStyles above is already\n * `position: \"relative\"`, so without this the overlay's `inset: 0` would\n * resolve against the whole component and rim the label and value rows too.\n * `zIndex: 1` below is unaffected: it already applied without positioning\n * (the track is a grid item), and it keeps applying now. */\n position: \"relative\",\n overflow: \"hidden\",\n /* Square, matching ProgressBar's track. The register's bar primitive (the XP\n * bar in design-handoff-v2/TerminalGlassLab.tsx) declares no border-radius on\n * either the track or the fill, so both compute to 0. */\n borderRadius: \"none\",\n backgroundColor: {\n /* The register's recessed surface: the same `var(--surface-inset)` the\n * handoff's bar track paints, and the same one ProgressBar uses. */\n default: \"pasteboard\",\n isStaticColor: \"transparent-overlay-300\",\n forcedColors: \"ButtonFace\",\n },\n outlineWidth: {\n default: 0,\n forcedColors: 1,\n },\n outlineStyle: {\n default: \"none\",\n forcedColors: \"solid\",\n },\n outlineColor: {\n default: \"transparent\",\n forcedColors: \"ButtonText\",\n },\n zIndex: 1,\n height: {\n default: 6,\n size: {\n S: 4,\n M: 6,\n L: 8,\n XL: 10,\n },\n },\n});\n\n/* The rim goes on its own absolutely-positioned layer rather than on trackStyles,\n * which is how the handoff paints it too (design-handoff-v2/TerminalGlassLab.tsx\n * lays an `inset: 0` / `pointer-events: none` / `box-shadow: var(--edge-glass)`\n * div over the bar's fills). The reason it cannot live on the track: an inset\n * box-shadow is painted with the element's own background, beneath every in-flow\n * descendant. `overflow: hidden` clips the fill but does not lift the track's\n * inset shadow above it, so a rim declared on the track would be occluded across\n * the filled fraction and survive only on the empty remainder — a half-rim that\n * reads as a bug. Kept local rather than shared with ProgressBar: the two have no\n * common style module today and inventing one widens a two-site fix. */\nconst trackRimStyles = style({\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n borderRadius: \"inherit\",\n boxShadow: \"edge-glass\",\n});\n\nconst fillStyles = style<MeterStyleState>({\n height: \"full\",\n borderStyle: \"none\",\n borderRadius: \"none\",\n backgroundColor: {\n default: lightDark(\"informative-800\", \"informative-900\"),\n variant: {\n positive: lightDark(\"positive-800\", \"positive-900\"),\n notice: lightDark(\"notice-800\", \"notice-900\"),\n negative: lightDark(\"negative-800\", \"negative-900\"),\n },\n isStaticColor: \"transparent-overlay-900\",\n forcedColors: \"ButtonText\",\n },\n});\n\n/* The discrete form. The register draws it as literal ▮/▯ glyphs in mono text\n * (TerminalGlassLab.tsx:918: `[▮▮▮▯▯] 3/5`); as a library primitive the blocks\n * are drawn divs at the glyph's box (7×12 — U+25AE's ink at the wells' 11.5px\n * mono), because a glyph's rendered size shifts with the consumer's font stack.\n * Filled and empty share one ink — the glyph pair differs only in fill, and the\n * register keeps channel color OFF the blocks (it lives on the row label). Here\n * the ink follows the variant so the meter still reads outside a well. No rim:\n * the blocks are marks, not a recessed surface. */\n/* Static (no conditions), so the macro yields a string used directly as a\n * class — same pattern as trackRimStyles above. */\nconst segmentRowStyles = style({\n gridArea: \"bar\",\n display: \"flex\",\n alignItems: \"center\",\n columnGap: \"[3px]\",\n});\n\ntype MeterSegmentStyleState = MeterStyleState & { isFilled: boolean };\n\nconst segmentStyles = style<MeterSegmentStyleState>({\n width: 7,\n height: 12,\n boxSizing: \"border-box\",\n borderStyle: \"solid\",\n borderWidth: 1,\n borderColor: {\n default: lightDark(\"informative-800\", \"informative-900\"),\n variant: {\n positive: lightDark(\"positive-800\", \"positive-900\"),\n notice: lightDark(\"notice-800\", \"notice-900\"),\n negative: lightDark(\"negative-800\", \"negative-900\"),\n },\n isStaticColor: \"transparent-overlay-900\",\n forcedColors: \"ButtonText\",\n },\n backgroundColor: {\n default: \"transparent\",\n isFilled: {\n default: lightDark(\"informative-800\", \"informative-900\"),\n variant: {\n positive: lightDark(\"positive-800\", \"positive-900\"),\n notice: lightDark(\"notice-800\", \"notice-900\"),\n negative: lightDark(\"negative-800\", \"negative-900\"),\n },\n isStaticColor: \"transparent-overlay-900\",\n forcedColors: \"ButtonText\",\n },\n },\n});\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\nfunction stringValueLabel(value: JSX.Element | undefined): string | undefined {\n if (typeof value === \"string\" || typeof value === \"number\") {\n return String(value);\n }\n return undefined;\n}\n\nfunction getDataAttributes(source: object): JSX.HTMLAttributes<HTMLDivElement> {\n const record = source as Record<string, unknown>;\n const attributes: Record<string, string | undefined> = {};\n\n for (const key in record) {\n if (key.startsWith(\"data-\")) {\n const value = record[key];\n attributes[key] = value == null ? undefined : String(value);\n }\n }\n\n return attributes as JSX.HTMLAttributes<HTMLDivElement>;\n}\n\nexport function Meter(props: MeterProps): JSX.Element {\n const contextProps = getSlottedContextProps(useContext(MeterContext), props.slot);\n const merged = mergeProps(contextProps ?? {}, props) as MeterProps & {\n class?: string;\n role?: string;\n style?: JSX.CSSProperties;\n showValueLabel?: boolean;\n children?: JSX.Element;\n };\n const [local] = splitProps(merged, [\n \"value\",\n \"minValue\",\n \"maxValue\",\n \"valueLabel\",\n \"formatOptions\",\n \"size\",\n \"segments\",\n \"variant\",\n \"label\",\n \"staticColor\",\n \"labelPosition\",\n \"styles\",\n \"UNSAFE_className\",\n \"UNSAFE_style\",\n \"slot\",\n \"ref\",\n \"id\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n \"class\",\n \"role\",\n \"style\",\n \"showValueLabel\",\n \"children\",\n ]);\n const labelId = createUniqueId();\n const size = () => local.size ?? \"M\";\n const variant = () => normalizeVariant(local.variant);\n const labelPosition = () => local.labelPosition ?? \"top\";\n const isStaticColor = () => !!local.staticColor;\n const state = (labelAlign?: \"start\" | \"end\"): MeterStyleState => ({\n size: size(),\n variant: variant(),\n staticColor: local.staticColor,\n labelPosition: labelPosition(),\n labelAlign,\n isStaticColor: isStaticColor(),\n isSegmented: segmentCount() != null,\n });\n const accessibleLabelledBy = () =>\n local[\"aria-labelledby\"] ?? (!local[\"aria-label\"] && local.label ? labelId : undefined);\n\n const meterAria = createMeter({\n get id() {\n return local.id;\n },\n get value() {\n return local.value;\n },\n get minValue() {\n return local.minValue;\n },\n get maxValue() {\n return local.maxValue;\n },\n get valueLabel() {\n return stringValueLabel(local.valueLabel);\n },\n get formatOptions() {\n return local.formatOptions;\n },\n get \"aria-label\"() {\n return local[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return accessibleLabelledBy();\n },\n get \"aria-describedby\"() {\n return local[\"aria-describedby\"];\n },\n get \"aria-details\"() {\n return local[\"aria-details\"];\n },\n });\n\n const percentage = createMemo(() => {\n const minValue = local.minValue ?? 0;\n const maxValue = local.maxValue ?? 100;\n const value = clamp(local.value ?? 0, minValue, maxValue);\n return ((value - minValue) / (maxValue - minValue)) * 100;\n });\n const valueText = () =>\n local.valueLabel ?? (meterAria.meterProps[\"aria-valuetext\"] as string | undefined);\n const segmentCount = () => {\n const segments = local.segments;\n return segments != null && Number.isFinite(segments) && segments >= 1\n ? Math.floor(segments)\n : null;\n };\n const filledCount = createMemo(() => {\n const segments = segmentCount();\n return segments == null ? 0 : clamp(Math.round((percentage() / 100) * segments), 0, segments);\n });\n const showValue = () => !!local.label;\n const mergedStyles = () => mergeContextStyles(contextProps?.styles, props.styles);\n const mergedUnsafeStyle = () =>\n mergeContextUnsafeStyle(contextProps?.UNSAFE_style, props.UNSAFE_style);\n\n return (\n <div\n {...getDataAttributes(merged)}\n {...meterAria.meterProps}\n role=\"meter\"\n ref={mergeContextRefs(\n (contextProps as { ref?: RefLike<HTMLDivElement> } | null)?.ref,\n props.ref,\n )}\n class={[local.UNSAFE_className, wrapperStyles(state(), mergedStyles())]\n .filter(Boolean)\n .join(\" \")}\n style={mergedUnsafeStyle()}\n slot={local.slot ?? undefined}\n >\n {local.label && (\n <div class={labelWrapperStyles(state(\"start\"))}>\n <span id={labelId} class={labelStyles(state(\"start\"))}>\n {local.label}\n </span>\n </div>\n )}\n {showValue() && <Text styles={valueStyles(state(\"end\"))}>{valueText()}</Text>}\n <SkeletonWrapper>\n {segmentCount() != null ? (\n <div class={segmentRowStyles} aria-hidden=\"true\">\n <For each={Array.from({ length: segmentCount() ?? 0 })}>\n {(_, index) => (\n <div class={segmentStyles({ ...state(), isFilled: index() < filledCount() })} />\n )}\n </For>\n </div>\n ) : (\n <div class={trackStyles(state())}>\n <div class={fillStyles(state())} style={{ width: `${percentage()}%` }} />\n <div aria-hidden=\"true\" class={trackRimStyles} />\n </div>\n )}\n </SkeletonWrapper>\n </div>\n );\n}\n"],"mappings":";;;;;;AAcA,SAAS,iBAAiB,SAAwC;CAClE,QAAW,SAAX;EACO,KAAA,WACL,OAAa;EACb,KAAW,WACD,OAAA;EACV,SACU,OAAA,WAAA;CACV;AACF;AA+BA,MAAO,eAAqB,cAAA,IAAA;AAU5B,MAAE,gBAAoB,SAAC,UAAA,OAAmB,WAAA;CACtC,IAAE,QAAS;CACb,IAAM,WAAU;CACd,IAAA,WAAA;CACA,IAAC,WAAW;CACZ,IAAI,UAAU,OAAO,aAAa,EAAC,EAAA,SAAM,+EAA0B;CACnE,KAAK,IAAE,KAAA,SAAA;EACL,IAAM,EAAA,OAAS,MAAE,WAAW;EAC7B,IAAA,EAAA,OAAU,KAAA,WAAA;EACX,IAAA,EAAA,OAAA,KAAA,WAAA;EACF,SAAW,EAAM;CACf;CACF,IAAA,MAAU,gBAAgB,SACtB,SAAU;MACN,IAAI,MAAO,gBAAA,SACf,SAAW;CAEb,IAAE,CAAG,UAAS,SAAQ;CACxB,SAAA;CACE,IAAE,MAAQ,kBAAkB,QACxB,SAAG;MACL,IAAA,MAAe,kBAAgB,OACnC,SAAA;CAEA,IAAA,MAAY,kBAAO,QACd,SAAM;MACJ,IAAM,MAAG,kBAAI,OACd,SAAQ;CAEb,SAAK;CACL,SAAK;CACL,IAAK,CAAA,UAAW,SAAM;CACtB,IAAK,C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AAS;GACT,OAAG,MAAA;EACP;EACA,IAAI,WAAG;GACH,OAAA,MAAA;EACJ;EACA,IAAI,aAAY;GACZ,OAAK,iBAAmB,MAAM,UAAC;EACnC;EACA,IAAC,gBAAA;GACD,OAAA,MAAe;EACjB;EACH,IAAA,eAAA;GACH,OAAA,MAAA"}
|
|
@@ -57,7 +57,7 @@ const notificationBadge = function anonymous(props, overrides) {
|
|
|
57
57
|
rules += " kh151";
|
|
58
58
|
rules += " jh151";
|
|
59
59
|
if (props.isStaticColor) rules += " -g_-g_c151";
|
|
60
|
-
else rules += " -g_-
|
|
60
|
+
else rules += " -g_-gnhAeB151";
|
|
61
61
|
rules += " -g_-lgb151";
|
|
62
62
|
if (props.size === "XL") if (props.isIndicatorOnly) rules += " -F_-Fspvr8c151";
|
|
63
63
|
else rules += " -F_-Fm151";
|
|
@@ -55,7 +55,7 @@ const notificationBadge = function anonymous(props, overrides) {
|
|
|
55
55
|
rules += " kh151";
|
|
56
56
|
rules += " jh151";
|
|
57
57
|
if (props.isStaticColor) rules += " -g_-g_c151";
|
|
58
|
-
else rules += " -g_-
|
|
58
|
+
else rules += " -g_-gnhAeB151";
|
|
59
59
|
rules += " -g_-lgb151";
|
|
60
60
|
if (props.size === "XL") if (props.isIndicatorOnly) rules += " -F_-Fspvr8c151";
|
|
61
61
|
else rules += " -F_-Fm151";
|
package/dist/picker/index.js
CHANGED
|
@@ -152,7 +152,7 @@ const pickerLabel = function anonymous(props) {
|
|
|
152
152
|
}
|
|
153
153
|
if (props.isStaticColor) rules += " pl151";
|
|
154
154
|
else if (props.isDisabled) rules += " pUvnvv151";
|
|
155
|
-
else rules += "
|
|
155
|
+
else rules += " pWQ7V3d151";
|
|
156
156
|
rules += " plb151";
|
|
157
157
|
rules += " ri151";
|
|
158
158
|
return rules;
|
|
@@ -312,7 +312,7 @@ const pickerValue = function anonymous(props) {
|
|
|
312
312
|
rules += " eb151";
|
|
313
313
|
rules += " Fb151";
|
|
314
314
|
rules += " p40ub4c151";
|
|
315
|
-
rules += "
|
|
315
|
+
rules += " pg8a8eWQ7V3d151";
|
|
316
316
|
return rules;
|
|
317
317
|
};
|
|
318
318
|
const pickerChevron = function anonymous(props) {
|
|
@@ -419,7 +419,7 @@ const pickerHelpText = function anonymous(props) {
|
|
|
419
419
|
} else if (props.isInvalid) {
|
|
420
420
|
rules += " pYjUhNc151";
|
|
421
421
|
rules += " plQBRyrc151";
|
|
422
|
-
} else rules += "
|
|
422
|
+
} else rules += " pWQ7V3d151";
|
|
423
423
|
rules += " _qb151";
|
|
424
424
|
rules += " TgOnRt151";
|
|
425
425
|
return rules;
|
package/dist/picker/index.jsx
CHANGED
|
@@ -143,7 +143,7 @@ const pickerLabel = function anonymous(props) {
|
|
|
143
143
|
}
|
|
144
144
|
if (props.isStaticColor) rules += " pl151";
|
|
145
145
|
else if (props.isDisabled) rules += " pUvnvv151";
|
|
146
|
-
else rules += "
|
|
146
|
+
else rules += " pWQ7V3d151";
|
|
147
147
|
rules += " plb151";
|
|
148
148
|
rules += " ri151";
|
|
149
149
|
return rules;
|
|
@@ -304,7 +304,7 @@ const pickerValue = function anonymous(props) {
|
|
|
304
304
|
rules += " eb151";
|
|
305
305
|
rules += " Fb151";
|
|
306
306
|
rules += " p40ub4c151";
|
|
307
|
-
rules += "
|
|
307
|
+
rules += " pg8a8eWQ7V3d151";
|
|
308
308
|
return rules;
|
|
309
309
|
};
|
|
310
310
|
const pickerValueText = " sb151 _ub151 _Nc151 Pc151 _Yb151 _7c151";
|
|
@@ -412,7 +412,7 @@ const pickerHelpText = function anonymous(props) {
|
|
|
412
412
|
} else if (props.isInvalid) {
|
|
413
413
|
rules += " pYjUhNc151";
|
|
414
414
|
rules += " plQBRyrc151";
|
|
415
|
-
} else rules += "
|
|
415
|
+
} else rules += " pWQ7V3d151";
|
|
416
416
|
rules += " _qb151";
|
|
417
417
|
rules += " TgOnRt151";
|
|
418
418
|
return rules;
|
package/dist/popover/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { className, createComponent, effect, getNextElement, getNextMarker, inse
|
|
|
4
4
|
import { Show, splitProps } from "solid-js";
|
|
5
5
|
import { OverlayArrow, Popover as Popover$1, PopoverTrigger as PopoverTrigger$1 } from "@proyecto-viviana/solidaria-components";
|
|
6
6
|
//#region src/popover/index.tsx
|
|
7
|
-
var _tmpl$ = /*#__PURE__*/ template(`<div>`), _tmpl$2 = /*#__PURE__*/ template(`<svg viewBox="0 0 18 10"><path transform="translate(0 -1)"d="M1 1L7.93799 8.52588C8.07224 8.67448 8.23607 8.79362 8.41895 8.87524C8.60182 8.95687 8.79973 8.9993 9 9C9.19984 8.99882 9.39724 8.95606 9.57959 8.87427C9.76193 8.79248 9.9253 8.67336 10.0591 8.5249L17 1">`), _tmpl$3 = /*#__PURE__*/ template(`<p class=" uxe7h4151 -_6BNtrc-b151 vx151 xb151 _xa151 _Fd151 _FnuYUweb151
|
|
7
|
+
var _tmpl$ = /*#__PURE__*/ template(`<div>`), _tmpl$2 = /*#__PURE__*/ template(`<svg viewBox="0 0 18 10"><path transform="translate(0 -1)"d="M1 1L7.93799 8.52588C8.07224 8.67448 8.23607 8.79362 8.41895 8.87524C8.60182 8.95687 8.79973 8.9993 9 9C9.19984 8.99882 9.39724 8.95606 9.57959 8.87427C9.76193 8.79248 9.9253 8.67336 10.0591 8.5249L17 1">`), _tmpl$3 = /*#__PURE__*/ template(`<p class=" uxe7h4151 -_6BNtrc-b151 vx151 xb151 _xa151 _Fd151 _FnuYUweb151 pWQ7V3d151 Js151">`), _tmpl$4 = /*#__PURE__*/ template(`<div><h3 class=" uiWD3ad151 ucJ9TBTb151 ud3Euai151 uea151 ugb151 uhd151 uje151 u2NhKxcl151 uic151 -_6BNtrc-e151 vx151 xe151 _xa151 xX0cczbd151 _xX0cczba151 xfe151 _xfa151 xfX0cczbd151 _xfX0cczba151 _Fd151 _FnuYUweb151 pHKLAu151"></h3><!$><!/>`);
|
|
8
8
|
const popoverStyles = function anonymous(props) {
|
|
9
9
|
let rules = " ";
|
|
10
10
|
if (props.colorScheme === "dark") rules += " -ICUGx-_pa151";
|
package/dist/popover/index.jsx
CHANGED
|
@@ -235,7 +235,7 @@ function PopoverArrow(props) {
|
|
|
235
235
|
}
|
|
236
236
|
const popoverHeaderStyles = " Gx151";
|
|
237
237
|
const popoverTitleStyles = " uiWD3ad151 ucJ9TBTb151 ud3Euai151 uea151 ugb151 uhd151 uje151 u2NhKxcl151 uic151 -_6BNtrc-e151 vx151 xe151 _xa151 xX0cczbd151 _xX0cczba151 xfe151 _xfa151 xfX0cczbd151 _xfX0cczba151 _Fd151 _FnuYUweb151 pHKLAu151";
|
|
238
|
-
const popoverDescriptionStyles = " uxe7h4151 -_6BNtrc-b151 vx151 xb151 _xa151 _Fd151 _FnuYUweb151
|
|
238
|
+
const popoverDescriptionStyles = " uxe7h4151 -_6BNtrc-b151 vx151 xb151 _xa151 _Fd151 _FnuYUweb151 pWQ7V3d151 Js151";
|
|
239
239
|
/**
|
|
240
240
|
* Header section for popover with title and optional description.
|
|
241
241
|
*/ function PopoverHeader(props) {
|
|
@@ -64,7 +64,7 @@ const blockStyles = function anonymous(props) {
|
|
|
64
64
|
else if (props.isLit) rules += " gj151";
|
|
65
65
|
else rules += " gh151";
|
|
66
66
|
else if (props.isLead) rules += " g9151";
|
|
67
|
-
else if (props.isLit) rules += "
|
|
67
|
+
else if (props.isLit) rules += " gnhAeB151";
|
|
68
68
|
else rules += " gW36Rud151";
|
|
69
69
|
if (props.isLit) rules += " glc151";
|
|
70
70
|
else rules += " gla151";
|
|
@@ -82,7 +82,7 @@ const blockStyles = function anonymous(props) {
|
|
|
82
82
|
if (props.isLit) rules += " _h3jWUfc151";
|
|
83
83
|
if (props.isLit) rules += " __ea151";
|
|
84
84
|
if (props.isStaticColor) rules += " -oArxZd-gj151";
|
|
85
|
-
else rules += " -oArxZd-
|
|
85
|
+
else rules += " -oArxZd-gnhAeB151";
|
|
86
86
|
rules += " -oArxZd-lgc151";
|
|
87
87
|
return rules;
|
|
88
88
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressCircle.js","names":[],"sources":["../../src/progress/ProgressCircle.tsx"],"sourcesContent":["import {\n type JSX,\n For,\n createContext,\n createMemo,\n mergeProps,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport { createProgressBar } from \"@proyecto-viviana/solidaria\";\nimport type { StyleString } from \"../style\";\nimport { style } from \"../style\" with { type: \"macro\" };\nimport { keyframes } from \"../style/style-macro\" with { type: \"macro\" };\nimport type { UnsafeClassName } from \"../s2-internal/style-utils\";\nimport {\n getAllowedOverrides,\n staticColor as staticColorStyles,\n} from \"../s2-internal/style-utils\" with { type: \"macro\" };\nimport {\n getSlottedContextProps,\n mergeContextRefs,\n mergeContextStyles,\n mergeContextUnsafeStyle,\n type RefLike,\n type SpectrumContextValue,\n} from \"../button/spectrum-context\";\n\nexport type ProgressCircleSize = \"S\" | \"M\" | \"L\";\nexport type ProgressCircleStaticColor = \"white\" | \"black\" | \"auto\";\n\nexport interface ProgressCircleProps {\n /** The current value. @default 0 */\n value?: number;\n /** The smallest value allowed. @default 0 */\n minValue?: number;\n /** The largest value allowed. @default 100 */\n maxValue?: number;\n /** Whether presentation is indeterminate. */\n isIndeterminate?: boolean;\n /** The size of the progress circle. @default 'M' */\n size?: ProgressCircleSize;\n /** The static color style to apply over a color background. */\n staticColor?: ProgressCircleStaticColor;\n /**\n * Content centered inside the ring — the register composes a headline count\n * over the pixel ring (TerminalGlassLab.tsx:640-662: \"3/5\" over \"FOCUS\").\n * Purely visual; the accessible value stays on the progressbar attributes.\n */\n children?: JSX.Element;\n /** Spectrum-defined generated classes. */\n styles?: StyleString | (() => StyleString | undefined);\n /** Additional CSS class name. Use only as a last resort. */\n UNSAFE_className?: UnsafeClassName | string;\n /** Additional inline styles. Use only as a last resort. */\n UNSAFE_style?: JSX.CSSProperties;\n id?: string;\n slot?: string | null;\n ref?: RefLike<HTMLDivElement>;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n \"aria-describedby\"?: string;\n \"aria-details\"?: string;\n [key: `data-${string}`]: string | undefined;\n}\n\nexport const ProgressCircleContext = createContext<SpectrumContextValue<ProgressCircleProps>>(null);\n\ntype ProgressCircleStyleState = {\n size: ProgressCircleSize;\n staticColor?: ProgressCircleStaticColor;\n isStaticColor: boolean;\n};\n\ntype RingBlockStyleState = ProgressCircleStyleState & {\n isLit: boolean;\n isLead: boolean;\n isIndeterminate: boolean;\n};\n\n/* The register's ring is not an arc — it is 16 discrete pixel blocks on a circle\n * (PIX_RING, TerminalGlassLab.tsx:74-90): lit blocks in the accent, the two at the\n * leading edge on a checker dither, the remainder recessed on the inset surface,\n * every block beveled with the edge-glass rim. Geometry is pure trig computed once\n * at module load, exactly like the spec (deterministic, so it is SSR-safe). The\n * spec's single instance is 7px blocks at radius 31 in a 76px box; each size here\n * keeps those proportions inside the existing S/M/L = 16/32/64 footprints. */\nconst RING_COUNT = 16;\n\ninterface RingGeometry {\n block: number;\n positions: { x: number; y: number }[];\n}\n\nfunction ringGeometry(container: number, radius: number, block: number): RingGeometry {\n return {\n block,\n positions: Array.from({ length: RING_COUNT }, (_, i) => {\n const a = (i / RING_COUNT) * Math.PI * 2 - Math.PI / 2;\n return {\n x: Math.round(container / 2 + radius * Math.cos(a) - block / 2),\n y: Math.round(container / 2 + radius * Math.sin(a) - block / 2),\n };\n }),\n };\n}\n\nconst RING_GEOMETRY: Record<ProgressCircleSize, RingGeometry> = {\n S: ringGeometry(16, 7, 2),\n M: ringGeometry(32, 13, 3),\n L: ringGeometry(64, 26, 6),\n};\n\n/* The spec's glxRingBlink (glasselated.css:325-335): each lit block snaps from\n * 15% to full opacity early in a 2.6s loop, step-end, staggered 0.16s per block —\n * a clockwise chase. Determinate rings gate it on prefers-reduced-motion (the\n * blink is decoration; the lit count carries the value). Indeterminate rings keep\n * it unconditionally: there the chase IS the \"something is happening\" signal, and\n * a frozen full ring would read as 100%. Gate is the CSS media condition, not a\n * runtime matchMedia check — Solid hydration trusts the server DOM (see Badge). */\nconst ringBlink = keyframes(`\n 0% {\n opacity: 0.15;\n }\n\n 12% {\n opacity: 1;\n }\n\n 100% {\n opacity: 1;\n }\n`);\n\nconst wrapperStyles = style<ProgressCircleStyleState>(\n {\n ...staticColorStyles(),\n position: \"relative\",\n size: {\n default: 32,\n size: {\n S: 16,\n L: 64,\n },\n },\n aspectRatio: \"square\",\n },\n getAllowedOverrides({ height: true }),\n);\n\nconst blockStyles = style<RingBlockStyleState>({\n position: \"absolute\",\n size: {\n default: 3,\n size: {\n S: 2,\n L: 6,\n },\n },\n backgroundColor: {\n /* Unlit blocks recess into the same inset surface as the linear track\n * (`pasteboard` carries `var(--surface-inset)` — see the note that was on the\n * old arc's trackStyles). Lead blocks go transparent so only their dither\n * paints, exactly like the spec's blocks whose checker shows the panel\n * through its off quarters. */\n default: \"pasteboard\",\n isLit: \"accent\",\n isLead: \"transparent\",\n isStaticColor: {\n default: \"transparent-overlay-300\",\n isLit: \"transparent-overlay-900\",\n isLead: \"transparent\",\n },\n forcedColors: {\n default: \"Background\",\n isLit: \"ButtonText\",\n },\n },\n /* The leading-edge dither: the register's one ordered-dither recipe,\n * repeating-conic checker at half the block's own size (3.5px tile on the\n * spec's 7px block = 2×2 sub-cells; scaled per size here). */\n backgroundImage: {\n isLead: \"[repeating-conic-gradient(var(--pv-ring-fill) 0% 25%, transparent 0% 50%)]\",\n },\n backgroundSize: {\n size: {\n S: \"[1px 1px]\",\n M: \"[1.5px 1.5px]\",\n L: \"[3px 3px]\",\n },\n },\n boxShadow: \"edge-glass\",\n animation: {\n isLit: {\n default: ringBlink,\n \"@media (prefers-reduced-motion: reduce)\": \"none\",\n },\n isIndeterminate: ringBlink,\n },\n animationDuration: {\n isLit: 2600,\n },\n animationTimingFunction: {\n isLit: \"[step-end]\",\n },\n animationIterationCount: {\n isLit: \"infinite\",\n },\n \"--pv-ring-fill\": {\n type: \"backgroundColor\",\n value: {\n default: \"accent\",\n isStaticColor: \"transparent-overlay-900\",\n forcedColors: \"ButtonText\",\n },\n },\n});\n\nconst centerStyles = style({\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n pointerEvents: \"none\",\n});\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\nfunction safeRange(min: number, max: number): number {\n const range = max - min;\n return Number.isFinite(range) && range > 0 ? range : 1;\n}\n\nfunction getDataAttributes(source: object): JSX.HTMLAttributes<HTMLDivElement> {\n const record = source as Record<string, unknown>;\n const attributes: Record<string, string | undefined> = {};\n\n for (const key in record) {\n if (key.startsWith(\"data-\")) {\n const value = record[key];\n attributes[key] = value == null ? undefined : String(value);\n }\n }\n\n return attributes as JSX.HTMLAttributes<HTMLDivElement>;\n}\n\nexport function ProgressCircle(props: ProgressCircleProps): JSX.Element {\n const contextProps = getSlottedContextProps(useContext(ProgressCircleContext), props.slot);\n const merged = mergeProps(contextProps ?? {}, props) as ProgressCircleProps;\n const [local] = splitProps(merged, [\n \"value\",\n \"minValue\",\n \"maxValue\",\n \"isIndeterminate\",\n \"size\",\n \"staticColor\",\n \"children\",\n \"styles\",\n \"UNSAFE_className\",\n \"UNSAFE_style\",\n \"slot\",\n \"ref\",\n \"id\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n ]);\n const size = () => local.size ?? \"M\";\n const isIndeterminate = () => local.isIndeterminate ?? false;\n const isStaticColor = () => !!local.staticColor;\n const state = (): ProgressCircleStyleState => ({\n size: size(),\n staticColor: local.staticColor,\n isStaticColor: isStaticColor(),\n });\n const progressAria = createProgressBar({\n get id() {\n return local.id;\n },\n get value() {\n return local.value;\n },\n get minValue() {\n return local.minValue;\n },\n get maxValue() {\n return local.maxValue;\n },\n get isIndeterminate() {\n return isIndeterminate();\n },\n get \"aria-label\"() {\n return local[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return local[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return local[\"aria-describedby\"];\n },\n get \"aria-details\"() {\n return local[\"aria-details\"];\n },\n });\n const percentage = createMemo(() => {\n const minValue = local.minValue ?? 0;\n const maxValue = local.maxValue ?? 100;\n const value = clamp(local.value ?? 0, minValue, maxValue);\n return ((value - minValue) / safeRange(minValue, maxValue)) * 100;\n });\n /* Value → block quantization. Indeterminate lights the whole ring and lets the\n * staggered blink chase around it. The spec's hardcoded 10-lit/2-dithered split\n * is generalized: the last two lit blocks dither while the ring is partial\n * (work in flight has a leading edge; a full or empty ring has none). */\n const litCount = createMemo(() =>\n isIndeterminate()\n ? RING_COUNT\n : clamp(Math.round((percentage() / 100) * RING_COUNT), 0, RING_COUNT),\n );\n const geometry = () => RING_GEOMETRY[size()];\n const mergedStyles = () => mergeContextStyles(contextProps?.styles, props.styles);\n const mergedUnsafeStyle = () =>\n mergeContextUnsafeStyle(contextProps?.UNSAFE_style, props.UNSAFE_style);\n\n return (\n <div\n {...getDataAttributes(merged)}\n {...progressAria.progressBarProps}\n data-rac=\"\"\n ref={mergeContextRefs(\n (contextProps as { ref?: RefLike<HTMLDivElement> } | null)?.ref,\n props.ref,\n )}\n class={[local.UNSAFE_className, wrapperStyles(state(), mergedStyles())]\n .filter(Boolean)\n .join(\" \")}\n style={mergedUnsafeStyle()}\n slot={local.slot ?? undefined}\n >\n <For each={geometry().positions}>\n {(position, index) => {\n const isLit = () => index() < litCount();\n const isLead = () =>\n !isIndeterminate() &&\n litCount() > 0 &&\n litCount() < RING_COUNT &&\n isLit() &&\n index() >= litCount() - 2;\n return (\n <div\n aria-hidden=\"true\"\n class={blockStyles({\n ...state(),\n isLit: isLit(),\n isLead: isLead(),\n isIndeterminate: isIndeterminate(),\n })}\n style={{\n left: `${position.x}px`,\n top: `${position.y}px`,\n /* The spec's stagger: i × 0.16s inside the 2.6s loop. Inert when\n * the media gate zeroes the animation-name. */\n \"animation-delay\": isLit() ? `${(index() * 0.16).toFixed(2)}s` : undefined,\n }}\n />\n );\n }}\n </For>\n {/* Read `children` exactly once per run — a repeated getter read\n * re-instantiates the subtree and desyncs hydration keys. */}\n {(() => {\n const content = local.children;\n return content != null ? <div class={centerStyles}>{content}</div> : undefined;\n })()}\n </div>\n );\n}\n"],"mappings":";;;;;;AAiEA,MAAa,wBAAwB,cAAyD,IAAA;AAqB9F,MAAM,aAAa;AAOnB,SAAS,aAAa,WAAmB,QAAgB,OAAgB;CACvE,OAAO;EACL;EACA,WAAW,MAAM,KAAK,EAAE,QAAQ,WAAW,IAAI,GAAG,MAAA;GAChD,MAAM,IAAK,IAAI,aAAc,KAAK,KAAK,IAAI,KAAK,KAAK;GACrD,OAAO;IACL,GAAG,KAAK,MAAM,YAAY,IAAI,SAAS,KAAK,IAAI,CAAA,IAAK,QAAQ,CAAA;IAC7D,GAAG,KAAK,MAAM,YAAY,IAAI,SAAS,KAAK,IAAI,CAAA,IAAK,QAAQ,CAAA;GAC/D;EACF,CAAA;CACF;AACF;AAEA,MAAM,gBAA0D;CAC9D,GAAG,aAAa,IAAI,GAAG,CAAA;CACvB,GAAG,aAAa,IAAI,IAAI,CAAA;CACxB,GAAG,aAAa,IAAI,IAAI,CAAA;AAC1B;AAuBA,MAAM,gBAAA,SAAA,UAAA,OAAA,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBN,MAAM,cAAA,SAAA,UAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EN,SAAS,MAAM,OAAe,KAAa,KAAoB;CAC7D,OAAO,KAAK,IAAI,KAAK,IAAI,OAAO,GAAA,GAAM,GAAA;AACxC;AAEA,SAAS,UAAU,KAAa,KAAoB;CAClD,MAAM,QAAQ,MAAM;CACpB,OAAO,OAAO,SAAS,KAAA,KAAU,QAAQ,IAAI,QAAQ;AACvD;AAEA,SAAS,kBAAkB,QAAoC;CAC7D,MAAM,SAAS;CACf,MAAM,aAAiD,CAAC;CAExD,KAAK,MAAM,OAAO,QAChB,IAAI,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EAAC,KAAI,OAGH,MAAA,IAAU,IAAI,MAAA,IAAU,KAAM,QAAQ,CAAA,EAAA,KAAQ,KAAA;MAAA,QAAA,IAAA,KAAA,UAAA,OAAA,IAAA,IAAA,GAAA;MAAA,SAAA,IAAA,KAAA,iBAAA,OAAA,QAAA,IAAA,IAAA,IAAA;MAAA,SAAA,IAAA,KAAA,iBAAA,OAAA,OAAA,IAAA,IAAA,IAAA;MAAA,SAAA,IAAA,KAAA,iBAAA,OAAA,mBAAA,IAAA,IAAA,IAAA;MAAA,OAAA;KAAA,GAAA;MAAA,GAAA,KAAA;MAAA,GAAA,KAAA;MAAA,GAAA,KAAA;MAAA,GAAA,KAAA;KAAA,CAAA;KAAA,OAAA;IAAA,GAAA;GAIzE;EAAA,CAAA,GAAA,OAAA,IAAA;EAAA,OAAA,YAIA;GACA,MAAM,UAAU,MAAM;GACtB,OAAO,WAAW,cAAA;IAAA,IAAA,QAAA,eAAA,OAAA;IAAA,OAAA,OAAkC,OAAA;IAAA,OAAA;GAAA,GAAA,IAAiB,KAAA;EACvE,GAAC,OAAA,KAAA;EAAA,mBAAA;EAAA,OAAA;CAAA,GAAA;AAGP"}
|
|
1
|
+
{"version":3,"file":"ProgressCircle.js","names":[],"sources":["../../src/progress/ProgressCircle.tsx"],"sourcesContent":["import {\n type JSX,\n For,\n createContext,\n createMemo,\n mergeProps,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport { createProgressBar } from \"@proyecto-viviana/solidaria\";\nimport type { StyleString } from \"../style\";\nimport { style } from \"../style\" with { type: \"macro\" };\nimport { keyframes } from \"../style/style-macro\" with { type: \"macro\" };\nimport type { UnsafeClassName } from \"../s2-internal/style-utils\";\nimport {\n getAllowedOverrides,\n staticColor as staticColorStyles,\n} from \"../s2-internal/style-utils\" with { type: \"macro\" };\nimport {\n getSlottedContextProps,\n mergeContextRefs,\n mergeContextStyles,\n mergeContextUnsafeStyle,\n type RefLike,\n type SpectrumContextValue,\n} from \"../button/spectrum-context\";\n\nexport type ProgressCircleSize = \"S\" | \"M\" | \"L\";\nexport type ProgressCircleStaticColor = \"white\" | \"black\" | \"auto\";\n\nexport interface ProgressCircleProps {\n /** The current value. @default 0 */\n value?: number;\n /** The smallest value allowed. @default 0 */\n minValue?: number;\n /** The largest value allowed. @default 100 */\n maxValue?: number;\n /** Whether presentation is indeterminate. */\n isIndeterminate?: boolean;\n /** The size of the progress circle. @default 'M' */\n size?: ProgressCircleSize;\n /** The static color style to apply over a color background. */\n staticColor?: ProgressCircleStaticColor;\n /**\n * Content centered inside the ring — the register composes a headline count\n * over the pixel ring (TerminalGlassLab.tsx:640-662: \"3/5\" over \"FOCUS\").\n * Purely visual; the accessible value stays on the progressbar attributes.\n */\n children?: JSX.Element;\n /** Spectrum-defined generated classes. */\n styles?: StyleString | (() => StyleString | undefined);\n /** Additional CSS class name. Use only as a last resort. */\n UNSAFE_className?: UnsafeClassName | string;\n /** Additional inline styles. Use only as a last resort. */\n UNSAFE_style?: JSX.CSSProperties;\n id?: string;\n slot?: string | null;\n ref?: RefLike<HTMLDivElement>;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n \"aria-describedby\"?: string;\n \"aria-details\"?: string;\n [key: `data-${string}`]: string | undefined;\n}\n\nexport const ProgressCircleContext = createContext<SpectrumContextValue<ProgressCircleProps>>(null);\n\ntype ProgressCircleStyleState = {\n size: ProgressCircleSize;\n staticColor?: ProgressCircleStaticColor;\n isStaticColor: boolean;\n};\n\ntype RingBlockStyleState = ProgressCircleStyleState & {\n isLit: boolean;\n isLead: boolean;\n isIndeterminate: boolean;\n};\n\n/* The register's ring is not an arc — it is 16 discrete pixel blocks on a circle\n * (PIX_RING, TerminalGlassLab.tsx:74-90): lit blocks in the accent, the two at the\n * leading edge on a checker dither, the remainder recessed on the inset surface,\n * every block beveled with the edge-glass rim. Geometry is pure trig computed once\n * at module load, exactly like the spec (deterministic, so it is SSR-safe). The\n * spec's single instance is 7px blocks at radius 31 in a 76px box; each size here\n * keeps those proportions inside the existing S/M/L = 16/32/64 footprints. */\nconst RING_COUNT = 16;\n\ninterface RingGeometry {\n block: number;\n positions: { x: number; y: number }[];\n}\n\nfunction ringGeometry(container: number, radius: number, block: number): RingGeometry {\n return {\n block,\n positions: Array.from({ length: RING_COUNT }, (_, i) => {\n const a = (i / RING_COUNT) * Math.PI * 2 - Math.PI / 2;\n return {\n x: Math.round(container / 2 + radius * Math.cos(a) - block / 2),\n y: Math.round(container / 2 + radius * Math.sin(a) - block / 2),\n };\n }),\n };\n}\n\nconst RING_GEOMETRY: Record<ProgressCircleSize, RingGeometry> = {\n S: ringGeometry(16, 7, 2),\n M: ringGeometry(32, 13, 3),\n L: ringGeometry(64, 26, 6),\n};\n\n/* The spec's glxRingBlink (glasselated.css:325-335): each lit block snaps from\n * 15% to full opacity early in a 2.6s loop, step-end, staggered 0.16s per block —\n * a clockwise chase. Determinate rings gate it on prefers-reduced-motion (the\n * blink is decoration; the lit count carries the value). Indeterminate rings keep\n * it unconditionally: there the chase IS the \"something is happening\" signal, and\n * a frozen full ring would read as 100%. Gate is the CSS media condition, not a\n * runtime matchMedia check — Solid hydration trusts the server DOM (see Badge). */\nconst ringBlink = keyframes(`\n 0% {\n opacity: 0.15;\n }\n\n 12% {\n opacity: 1;\n }\n\n 100% {\n opacity: 1;\n }\n`);\n\nconst wrapperStyles = style<ProgressCircleStyleState>(\n {\n ...staticColorStyles(),\n position: \"relative\",\n size: {\n default: 32,\n size: {\n S: 16,\n L: 64,\n },\n },\n aspectRatio: \"square\",\n },\n getAllowedOverrides({ height: true }),\n);\n\nconst blockStyles = style<RingBlockStyleState>({\n position: \"absolute\",\n size: {\n default: 3,\n size: {\n S: 2,\n L: 6,\n },\n },\n backgroundColor: {\n /* Unlit blocks recess into the same inset surface as the linear track\n * (`pasteboard` carries `var(--surface-inset)` — see the note that was on the\n * old arc's trackStyles). Lead blocks go transparent so only their dither\n * paints, exactly like the spec's blocks whose checker shows the panel\n * through its off quarters. */\n default: \"pasteboard\",\n isLit: \"accent\",\n isLead: \"transparent\",\n isStaticColor: {\n default: \"transparent-overlay-300\",\n isLit: \"transparent-overlay-900\",\n isLead: \"transparent\",\n },\n forcedColors: {\n default: \"Background\",\n isLit: \"ButtonText\",\n },\n },\n /* The leading-edge dither: the register's one ordered-dither recipe,\n * repeating-conic checker at half the block's own size (3.5px tile on the\n * spec's 7px block = 2×2 sub-cells; scaled per size here). */\n backgroundImage: {\n isLead: \"[repeating-conic-gradient(var(--pv-ring-fill) 0% 25%, transparent 0% 50%)]\",\n },\n backgroundSize: {\n size: {\n S: \"[1px 1px]\",\n M: \"[1.5px 1.5px]\",\n L: \"[3px 3px]\",\n },\n },\n boxShadow: \"edge-glass\",\n animation: {\n isLit: {\n default: ringBlink,\n \"@media (prefers-reduced-motion: reduce)\": \"none\",\n },\n isIndeterminate: ringBlink,\n },\n animationDuration: {\n isLit: 2600,\n },\n animationTimingFunction: {\n isLit: \"[step-end]\",\n },\n animationIterationCount: {\n isLit: \"infinite\",\n },\n \"--pv-ring-fill\": {\n type: \"backgroundColor\",\n value: {\n default: \"accent\",\n isStaticColor: \"transparent-overlay-900\",\n forcedColors: \"ButtonText\",\n },\n },\n});\n\nconst centerStyles = style({\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n pointerEvents: \"none\",\n});\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\nfunction safeRange(min: number, max: number): number {\n const range = max - min;\n return Number.isFinite(range) && range > 0 ? range : 1;\n}\n\nfunction getDataAttributes(source: object): JSX.HTMLAttributes<HTMLDivElement> {\n const record = source as Record<string, unknown>;\n const attributes: Record<string, string | undefined> = {};\n\n for (const key in record) {\n if (key.startsWith(\"data-\")) {\n const value = record[key];\n attributes[key] = value == null ? undefined : String(value);\n }\n }\n\n return attributes as JSX.HTMLAttributes<HTMLDivElement>;\n}\n\nexport function ProgressCircle(props: ProgressCircleProps): JSX.Element {\n const contextProps = getSlottedContextProps(useContext(ProgressCircleContext), props.slot);\n const merged = mergeProps(contextProps ?? {}, props) as ProgressCircleProps;\n const [local] = splitProps(merged, [\n \"value\",\n \"minValue\",\n \"maxValue\",\n \"isIndeterminate\",\n \"size\",\n \"staticColor\",\n \"children\",\n \"styles\",\n \"UNSAFE_className\",\n \"UNSAFE_style\",\n \"slot\",\n \"ref\",\n \"id\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n ]);\n const size = () => local.size ?? \"M\";\n const isIndeterminate = () => local.isIndeterminate ?? false;\n const isStaticColor = () => !!local.staticColor;\n const state = (): ProgressCircleStyleState => ({\n size: size(),\n staticColor: local.staticColor,\n isStaticColor: isStaticColor(),\n });\n const progressAria = createProgressBar({\n get id() {\n return local.id;\n },\n get value() {\n return local.value;\n },\n get minValue() {\n return local.minValue;\n },\n get maxValue() {\n return local.maxValue;\n },\n get isIndeterminate() {\n return isIndeterminate();\n },\n get \"aria-label\"() {\n return local[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return local[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return local[\"aria-describedby\"];\n },\n get \"aria-details\"() {\n return local[\"aria-details\"];\n },\n });\n const percentage = createMemo(() => {\n const minValue = local.minValue ?? 0;\n const maxValue = local.maxValue ?? 100;\n const value = clamp(local.value ?? 0, minValue, maxValue);\n return ((value - minValue) / safeRange(minValue, maxValue)) * 100;\n });\n /* Value → block quantization. Indeterminate lights the whole ring and lets the\n * staggered blink chase around it. The spec's hardcoded 10-lit/2-dithered split\n * is generalized: the last two lit blocks dither while the ring is partial\n * (work in flight has a leading edge; a full or empty ring has none). */\n const litCount = createMemo(() =>\n isIndeterminate()\n ? RING_COUNT\n : clamp(Math.round((percentage() / 100) * RING_COUNT), 0, RING_COUNT),\n );\n const geometry = () => RING_GEOMETRY[size()];\n const mergedStyles = () => mergeContextStyles(contextProps?.styles, props.styles);\n const mergedUnsafeStyle = () =>\n mergeContextUnsafeStyle(contextProps?.UNSAFE_style, props.UNSAFE_style);\n\n return (\n <div\n {...getDataAttributes(merged)}\n {...progressAria.progressBarProps}\n data-rac=\"\"\n ref={mergeContextRefs(\n (contextProps as { ref?: RefLike<HTMLDivElement> } | null)?.ref,\n props.ref,\n )}\n class={[local.UNSAFE_className, wrapperStyles(state(), mergedStyles())]\n .filter(Boolean)\n .join(\" \")}\n style={mergedUnsafeStyle()}\n slot={local.slot ?? undefined}\n >\n <For each={geometry().positions}>\n {(position, index) => {\n const isLit = () => index() < litCount();\n const isLead = () =>\n !isIndeterminate() &&\n litCount() > 0 &&\n litCount() < RING_COUNT &&\n isLit() &&\n index() >= litCount() - 2;\n return (\n <div\n aria-hidden=\"true\"\n class={blockStyles({\n ...state(),\n isLit: isLit(),\n isLead: isLead(),\n isIndeterminate: isIndeterminate(),\n })}\n style={{\n left: `${position.x}px`,\n top: `${position.y}px`,\n /* The spec's stagger: i × 0.16s inside the 2.6s loop. Inert when\n * the media gate zeroes the animation-name. */\n \"animation-delay\": isLit() ? `${(index() * 0.16).toFixed(2)}s` : undefined,\n }}\n />\n );\n }}\n </For>\n {/* Read `children` exactly once per run — a repeated getter read\n * re-instantiates the subtree and desyncs hydration keys. */}\n {(() => {\n const content = local.children;\n return content != null ? <div class={centerStyles}>{content}</div> : undefined;\n })()}\n </div>\n );\n}\n"],"mappings":";;;;;;AAiEA,MAAa,wBAAwB,cAAyD,IAAA;AAqB9F,MAAM,aAAa;AAOnB,SAAS,aAAa,WAAmB,QAAgB,OAAgB;CACvE,OAAO;EACL;EACA,WAAW,MAAM,KAAK,EAAE,QAAQ,WAAW,IAAI,GAAG,MAAA;GAChD,MAAM,IAAK,IAAI,aAAc,KAAK,KAAK,IAAI,KAAK,KAAK;GACrD,OAAO;IACL,GAAG,KAAK,MAAM,YAAY,IAAI,SAAS,KAAK,IAAI,CAAA,IAAK,QAAQ,CAAA;IAC7D,GAAG,KAAK,MAAM,YAAY,IAAI,SAAS,KA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AO,WAAW,cAAA;IAAA,IAAA,QAAA,eAAA,OAAA;IAAA,OAAA,OAAkC,OAAA;IAAA,OAAA;GAAA,GAAA,IAAiB,KAAA;EACvE,GAAC,OAAA,KAAA;EAAA,mBAAA;EAAA,OAAA;CAAA,GAAA;AAGP"}
|
|
@@ -62,7 +62,7 @@ const blockStyles = function anonymous(props) {
|
|
|
62
62
|
else if (props.isLit) rules += " gj151";
|
|
63
63
|
else rules += " gh151";
|
|
64
64
|
else if (props.isLead) rules += " g9151";
|
|
65
|
-
else if (props.isLit) rules += "
|
|
65
|
+
else if (props.isLit) rules += " gnhAeB151";
|
|
66
66
|
else rules += " gW36Rud151";
|
|
67
67
|
if (props.isLit) rules += " glc151";
|
|
68
68
|
else rules += " gla151";
|
|
@@ -80,7 +80,7 @@ const blockStyles = function anonymous(props) {
|
|
|
80
80
|
if (props.isLit) rules += " _h3jWUfc151";
|
|
81
81
|
if (props.isLit) rules += " __ea151";
|
|
82
82
|
if (props.isStaticColor) rules += " -oArxZd-gj151";
|
|
83
|
-
else rules += " -oArxZd-
|
|
83
|
+
else rules += " -oArxZd-gnhAeB151";
|
|
84
84
|
rules += " -oArxZd-lgc151";
|
|
85
85
|
return rules;
|
|
86
86
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressCircle.jsx","names":[],"sources":["../../src/progress/ProgressCircle.tsx"],"sourcesContent":["import {\n type JSX,\n For,\n createContext,\n createMemo,\n mergeProps,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport { createProgressBar } from \"@proyecto-viviana/solidaria\";\nimport type { StyleString } from \"../style\";\nimport { style } from \"../style\" with { type: \"macro\" };\nimport { keyframes } from \"../style/style-macro\" with { type: \"macro\" };\nimport type { UnsafeClassName } from \"../s2-internal/style-utils\";\nimport {\n getAllowedOverrides,\n staticColor as staticColorStyles,\n} from \"../s2-internal/style-utils\" with { type: \"macro\" };\nimport {\n getSlottedContextProps,\n mergeContextRefs,\n mergeContextStyles,\n mergeContextUnsafeStyle,\n type RefLike,\n type SpectrumContextValue,\n} from \"../button/spectrum-context\";\n\nexport type ProgressCircleSize = \"S\" | \"M\" | \"L\";\nexport type ProgressCircleStaticColor = \"white\" | \"black\" | \"auto\";\n\nexport interface ProgressCircleProps {\n /** The current value. @default 0 */\n value?: number;\n /** The smallest value allowed. @default 0 */\n minValue?: number;\n /** The largest value allowed. @default 100 */\n maxValue?: number;\n /** Whether presentation is indeterminate. */\n isIndeterminate?: boolean;\n /** The size of the progress circle. @default 'M' */\n size?: ProgressCircleSize;\n /** The static color style to apply over a color background. */\n staticColor?: ProgressCircleStaticColor;\n /**\n * Content centered inside the ring — the register composes a headline count\n * over the pixel ring (TerminalGlassLab.tsx:640-662: \"3/5\" over \"FOCUS\").\n * Purely visual; the accessible value stays on the progressbar attributes.\n */\n children?: JSX.Element;\n /** Spectrum-defined generated classes. */\n styles?: StyleString | (() => StyleString | undefined);\n /** Additional CSS class name. Use only as a last resort. */\n UNSAFE_className?: UnsafeClassName | string;\n /** Additional inline styles. Use only as a last resort. */\n UNSAFE_style?: JSX.CSSProperties;\n id?: string;\n slot?: string | null;\n ref?: RefLike<HTMLDivElement>;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n \"aria-describedby\"?: string;\n \"aria-details\"?: string;\n [key: `data-${string}`]: string | undefined;\n}\n\nexport const ProgressCircleContext = createContext<SpectrumContextValue<ProgressCircleProps>>(null);\n\ntype ProgressCircleStyleState = {\n size: ProgressCircleSize;\n staticColor?: ProgressCircleStaticColor;\n isStaticColor: boolean;\n};\n\ntype RingBlockStyleState = ProgressCircleStyleState & {\n isLit: boolean;\n isLead: boolean;\n isIndeterminate: boolean;\n};\n\n/* The register's ring is not an arc — it is 16 discrete pixel blocks on a circle\n * (PIX_RING, TerminalGlassLab.tsx:74-90): lit blocks in the accent, the two at the\n * leading edge on a checker dither, the remainder recessed on the inset surface,\n * every block beveled with the edge-glass rim. Geometry is pure trig computed once\n * at module load, exactly like the spec (deterministic, so it is SSR-safe). The\n * spec's single instance is 7px blocks at radius 31 in a 76px box; each size here\n * keeps those proportions inside the existing S/M/L = 16/32/64 footprints. */\nconst RING_COUNT = 16;\n\ninterface RingGeometry {\n block: number;\n positions: { x: number; y: number }[];\n}\n\nfunction ringGeometry(container: number, radius: number, block: number): RingGeometry {\n return {\n block,\n positions: Array.from({ length: RING_COUNT }, (_, i) => {\n const a = (i / RING_COUNT) * Math.PI * 2 - Math.PI / 2;\n return {\n x: Math.round(container / 2 + radius * Math.cos(a) - block / 2),\n y: Math.round(container / 2 + radius * Math.sin(a) - block / 2),\n };\n }),\n };\n}\n\nconst RING_GEOMETRY: Record<ProgressCircleSize, RingGeometry> = {\n S: ringGeometry(16, 7, 2),\n M: ringGeometry(32, 13, 3),\n L: ringGeometry(64, 26, 6),\n};\n\n/* The spec's glxRingBlink (glasselated.css:325-335): each lit block snaps from\n * 15% to full opacity early in a 2.6s loop, step-end, staggered 0.16s per block —\n * a clockwise chase. Determinate rings gate it on prefers-reduced-motion (the\n * blink is decoration; the lit count carries the value). Indeterminate rings keep\n * it unconditionally: there the chase IS the \"something is happening\" signal, and\n * a frozen full ring would read as 100%. Gate is the CSS media condition, not a\n * runtime matchMedia check — Solid hydration trusts the server DOM (see Badge). */\nconst ringBlink = keyframes(`\n 0% {\n opacity: 0.15;\n }\n\n 12% {\n opacity: 1;\n }\n\n 100% {\n opacity: 1;\n }\n`);\n\nconst wrapperStyles = style<ProgressCircleStyleState>(\n {\n ...staticColorStyles(),\n position: \"relative\",\n size: {\n default: 32,\n size: {\n S: 16,\n L: 64,\n },\n },\n aspectRatio: \"square\",\n },\n getAllowedOverrides({ height: true }),\n);\n\nconst blockStyles = style<RingBlockStyleState>({\n position: \"absolute\",\n size: {\n default: 3,\n size: {\n S: 2,\n L: 6,\n },\n },\n backgroundColor: {\n /* Unlit blocks recess into the same inset surface as the linear track\n * (`pasteboard` carries `var(--surface-inset)` — see the note that was on the\n * old arc's trackStyles). Lead blocks go transparent so only their dither\n * paints, exactly like the spec's blocks whose checker shows the panel\n * through its off quarters. */\n default: \"pasteboard\",\n isLit: \"accent\",\n isLead: \"transparent\",\n isStaticColor: {\n default: \"transparent-overlay-300\",\n isLit: \"transparent-overlay-900\",\n isLead: \"transparent\",\n },\n forcedColors: {\n default: \"Background\",\n isLit: \"ButtonText\",\n },\n },\n /* The leading-edge dither: the register's one ordered-dither recipe,\n * repeating-conic checker at half the block's own size (3.5px tile on the\n * spec's 7px block = 2×2 sub-cells; scaled per size here). */\n backgroundImage: {\n isLead: \"[repeating-conic-gradient(var(--pv-ring-fill) 0% 25%, transparent 0% 50%)]\",\n },\n backgroundSize: {\n size: {\n S: \"[1px 1px]\",\n M: \"[1.5px 1.5px]\",\n L: \"[3px 3px]\",\n },\n },\n boxShadow: \"edge-glass\",\n animation: {\n isLit: {\n default: ringBlink,\n \"@media (prefers-reduced-motion: reduce)\": \"none\",\n },\n isIndeterminate: ringBlink,\n },\n animationDuration: {\n isLit: 2600,\n },\n animationTimingFunction: {\n isLit: \"[step-end]\",\n },\n animationIterationCount: {\n isLit: \"infinite\",\n },\n \"--pv-ring-fill\": {\n type: \"backgroundColor\",\n value: {\n default: \"accent\",\n isStaticColor: \"transparent-overlay-900\",\n forcedColors: \"ButtonText\",\n },\n },\n});\n\nconst centerStyles = style({\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n pointerEvents: \"none\",\n});\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\nfunction safeRange(min: number, max: number): number {\n const range = max - min;\n return Number.isFinite(range) && range > 0 ? range : 1;\n}\n\nfunction getDataAttributes(source: object): JSX.HTMLAttributes<HTMLDivElement> {\n const record = source as Record<string, unknown>;\n const attributes: Record<string, string | undefined> = {};\n\n for (const key in record) {\n if (key.startsWith(\"data-\")) {\n const value = record[key];\n attributes[key] = value == null ? undefined : String(value);\n }\n }\n\n return attributes as JSX.HTMLAttributes<HTMLDivElement>;\n}\n\nexport function ProgressCircle(props: ProgressCircleProps): JSX.Element {\n const contextProps = getSlottedContextProps(useContext(ProgressCircleContext), props.slot);\n const merged = mergeProps(contextProps ?? {}, props) as ProgressCircleProps;\n const [local] = splitProps(merged, [\n \"value\",\n \"minValue\",\n \"maxValue\",\n \"isIndeterminate\",\n \"size\",\n \"staticColor\",\n \"children\",\n \"styles\",\n \"UNSAFE_className\",\n \"UNSAFE_style\",\n \"slot\",\n \"ref\",\n \"id\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n ]);\n const size = () => local.size ?? \"M\";\n const isIndeterminate = () => local.isIndeterminate ?? false;\n const isStaticColor = () => !!local.staticColor;\n const state = (): ProgressCircleStyleState => ({\n size: size(),\n staticColor: local.staticColor,\n isStaticColor: isStaticColor(),\n });\n const progressAria = createProgressBar({\n get id() {\n return local.id;\n },\n get value() {\n return local.value;\n },\n get minValue() {\n return local.minValue;\n },\n get maxValue() {\n return local.maxValue;\n },\n get isIndeterminate() {\n return isIndeterminate();\n },\n get \"aria-label\"() {\n return local[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return local[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return local[\"aria-describedby\"];\n },\n get \"aria-details\"() {\n return local[\"aria-details\"];\n },\n });\n const percentage = createMemo(() => {\n const minValue = local.minValue ?? 0;\n const maxValue = local.maxValue ?? 100;\n const value = clamp(local.value ?? 0, minValue, maxValue);\n return ((value - minValue) / safeRange(minValue, maxValue)) * 100;\n });\n /* Value → block quantization. Indeterminate lights the whole ring and lets the\n * staggered blink chase around it. The spec's hardcoded 10-lit/2-dithered split\n * is generalized: the last two lit blocks dither while the ring is partial\n * (work in flight has a leading edge; a full or empty ring has none). */\n const litCount = createMemo(() =>\n isIndeterminate()\n ? RING_COUNT\n : clamp(Math.round((percentage() / 100) * RING_COUNT), 0, RING_COUNT),\n );\n const geometry = () => RING_GEOMETRY[size()];\n const mergedStyles = () => mergeContextStyles(contextProps?.styles, props.styles);\n const mergedUnsafeStyle = () =>\n mergeContextUnsafeStyle(contextProps?.UNSAFE_style, props.UNSAFE_style);\n\n return (\n <div\n {...getDataAttributes(merged)}\n {...progressAria.progressBarProps}\n data-rac=\"\"\n ref={mergeContextRefs(\n (contextProps as { ref?: RefLike<HTMLDivElement> } | null)?.ref,\n props.ref,\n )}\n class={[local.UNSAFE_className, wrapperStyles(state(), mergedStyles())]\n .filter(Boolean)\n .join(\" \")}\n style={mergedUnsafeStyle()}\n slot={local.slot ?? undefined}\n >\n <For each={geometry().positions}>\n {(position, index) => {\n const isLit = () => index() < litCount();\n const isLead = () =>\n !isIndeterminate() &&\n litCount() > 0 &&\n litCount() < RING_COUNT &&\n isLit() &&\n index() >= litCount() - 2;\n return (\n <div\n aria-hidden=\"true\"\n class={blockStyles({\n ...state(),\n isLit: isLit(),\n isLead: isLead(),\n isIndeterminate: isIndeterminate(),\n })}\n style={{\n left: `${position.x}px`,\n top: `${position.y}px`,\n /* The spec's stagger: i × 0.16s inside the 2.6s loop. Inert when\n * the media gate zeroes the animation-name. */\n \"animation-delay\": isLit() ? `${(index() * 0.16).toFixed(2)}s` : undefined,\n }}\n />\n );\n }}\n </For>\n {/* Read `children` exactly once per run — a repeated getter read\n * re-instantiates the subtree and desyncs hydration keys. */}\n {(() => {\n const content = local.children;\n return content != null ? <div class={centerStyles}>{content}</div> : undefined;\n })()}\n </div>\n );\n}\n"],"mappings":";;;;AA+BA,MAAU,wBAA2B,cAAA,IAAA;AAiBb,MAAA,aAAA;AAQxB,SAAS,aAAa,WAAA,QAAA,OAAA;CACpB,OAAM;EACA;EACA,WAAW,MAAG,KAAM,EACpB,QAAY,WACZ,IAAA,GAAO,MAAI;GACV,MAAO,IAAO,IAAI,aAAS,KAAS,KAAA,IAAA,KAAA,KAAA;GAC7C,OAAA;;IAEa,GAAA,KAAA,MAAA,YAAwB,IAAA,SAAc,KAAA,IAAA,CAAA,IAAA,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AA;EACtB,OAAA,CAAA,IAAA,mBAAA,OAAA,YAAA;GACG,GAAA,MAAW;GACP,OAAO,MAAA;GACd,QAAA,OAAA;GACG,iBAAkB,gBAAA;EACpB,CAAA,GAAM,OAAC;GACR,MAAA,GAAA,SAAA,EAAA;GACI,KAAK,GAAM,SAAG,EAAA;GAElB,mBAAA,MAAA,IAAA,IAAA,MAAA,IAAA,KAAA,QAAA,CAAA,EAAA,KAAA,KAAA;EACG;CACJ,EAAE;MACD,EAAA,IAAA;QACG;cACI;EACP,MAAA,UAAA,MAAA;EACG,OAAM,WAAW,OAAA,CAAA,IAAA,OAAA,eAAA,QAAA,EAAA,OAAA,KAAA;CACrB,GAAE,EAAA;IACF,EAAC;AACL"}
|
|
1
|
+
{"version":3,"file":"ProgressCircle.jsx","names":[],"sources":["../../src/progress/ProgressCircle.tsx"],"sourcesContent":["import {\n type JSX,\n For,\n createContext,\n createMemo,\n mergeProps,\n splitProps,\n useContext,\n} from \"solid-js\";\nimport { createProgressBar } from \"@proyecto-viviana/solidaria\";\nimport type { StyleString } from \"../style\";\nimport { style } from \"../style\" with { type: \"macro\" };\nimport { keyframes } from \"../style/style-macro\" with { type: \"macro\" };\nimport type { UnsafeClassName } from \"../s2-internal/style-utils\";\nimport {\n getAllowedOverrides,\n staticColor as staticColorStyles,\n} from \"../s2-internal/style-utils\" with { type: \"macro\" };\nimport {\n getSlottedContextProps,\n mergeContextRefs,\n mergeContextStyles,\n mergeContextUnsafeStyle,\n type RefLike,\n type SpectrumContextValue,\n} from \"../button/spectrum-context\";\n\nexport type ProgressCircleSize = \"S\" | \"M\" | \"L\";\nexport type ProgressCircleStaticColor = \"white\" | \"black\" | \"auto\";\n\nexport interface ProgressCircleProps {\n /** The current value. @default 0 */\n value?: number;\n /** The smallest value allowed. @default 0 */\n minValue?: number;\n /** The largest value allowed. @default 100 */\n maxValue?: number;\n /** Whether presentation is indeterminate. */\n isIndeterminate?: boolean;\n /** The size of the progress circle. @default 'M' */\n size?: ProgressCircleSize;\n /** The static color style to apply over a color background. */\n staticColor?: ProgressCircleStaticColor;\n /**\n * Content centered inside the ring — the register composes a headline count\n * over the pixel ring (TerminalGlassLab.tsx:640-662: \"3/5\" over \"FOCUS\").\n * Purely visual; the accessible value stays on the progressbar attributes.\n */\n children?: JSX.Element;\n /** Spectrum-defined generated classes. */\n styles?: StyleString | (() => StyleString | undefined);\n /** Additional CSS class name. Use only as a last resort. */\n UNSAFE_className?: UnsafeClassName | string;\n /** Additional inline styles. Use only as a last resort. */\n UNSAFE_style?: JSX.CSSProperties;\n id?: string;\n slot?: string | null;\n ref?: RefLike<HTMLDivElement>;\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n \"aria-describedby\"?: string;\n \"aria-details\"?: string;\n [key: `data-${string}`]: string | undefined;\n}\n\nexport const ProgressCircleContext = createContext<SpectrumContextValue<ProgressCircleProps>>(null);\n\ntype ProgressCircleStyleState = {\n size: ProgressCircleSize;\n staticColor?: ProgressCircleStaticColor;\n isStaticColor: boolean;\n};\n\ntype RingBlockStyleState = ProgressCircleStyleState & {\n isLit: boolean;\n isLead: boolean;\n isIndeterminate: boolean;\n};\n\n/* The register's ring is not an arc — it is 16 discrete pixel blocks on a circle\n * (PIX_RING, TerminalGlassLab.tsx:74-90): lit blocks in the accent, the two at the\n * leading edge on a checker dither, the remainder recessed on the inset surface,\n * every block beveled with the edge-glass rim. Geometry is pure trig computed once\n * at module load, exactly like the spec (deterministic, so it is SSR-safe). The\n * spec's single instance is 7px blocks at radius 31 in a 76px box; each size here\n * keeps those proportions inside the existing S/M/L = 16/32/64 footprints. */\nconst RING_COUNT = 16;\n\ninterface RingGeometry {\n block: number;\n positions: { x: number; y: number }[];\n}\n\nfunction ringGeometry(container: number, radius: number, block: number): RingGeometry {\n return {\n block,\n positions: Array.from({ length: RING_COUNT }, (_, i) => {\n const a = (i / RING_COUNT) * Math.PI * 2 - Math.PI / 2;\n return {\n x: Math.round(container / 2 + radius * Math.cos(a) - block / 2),\n y: Math.round(container / 2 + radius * Math.sin(a) - block / 2),\n };\n }),\n };\n}\n\nconst RING_GEOMETRY: Record<ProgressCircleSize, RingGeometry> = {\n S: ringGeometry(16, 7, 2),\n M: ringGeometry(32, 13, 3),\n L: ringGeometry(64, 26, 6),\n};\n\n/* The spec's glxRingBlink (glasselated.css:325-335): each lit block snaps from\n * 15% to full opacity early in a 2.6s loop, step-end, staggered 0.16s per block —\n * a clockwise chase. Determinate rings gate it on prefers-reduced-motion (the\n * blink is decoration; the lit count carries the value). Indeterminate rings keep\n * it unconditionally: there the chase IS the \"something is happening\" signal, and\n * a frozen full ring would read as 100%. Gate is the CSS media condition, not a\n * runtime matchMedia check — Solid hydration trusts the server DOM (see Badge). */\nconst ringBlink = keyframes(`\n 0% {\n opacity: 0.15;\n }\n\n 12% {\n opacity: 1;\n }\n\n 100% {\n opacity: 1;\n }\n`);\n\nconst wrapperStyles = style<ProgressCircleStyleState>(\n {\n ...staticColorStyles(),\n position: \"relative\",\n size: {\n default: 32,\n size: {\n S: 16,\n L: 64,\n },\n },\n aspectRatio: \"square\",\n },\n getAllowedOverrides({ height: true }),\n);\n\nconst blockStyles = style<RingBlockStyleState>({\n position: \"absolute\",\n size: {\n default: 3,\n size: {\n S: 2,\n L: 6,\n },\n },\n backgroundColor: {\n /* Unlit blocks recess into the same inset surface as the linear track\n * (`pasteboard` carries `var(--surface-inset)` — see the note that was on the\n * old arc's trackStyles). Lead blocks go transparent so only their dither\n * paints, exactly like the spec's blocks whose checker shows the panel\n * through its off quarters. */\n default: \"pasteboard\",\n isLit: \"accent\",\n isLead: \"transparent\",\n isStaticColor: {\n default: \"transparent-overlay-300\",\n isLit: \"transparent-overlay-900\",\n isLead: \"transparent\",\n },\n forcedColors: {\n default: \"Background\",\n isLit: \"ButtonText\",\n },\n },\n /* The leading-edge dither: the register's one ordered-dither recipe,\n * repeating-conic checker at half the block's own size (3.5px tile on the\n * spec's 7px block = 2×2 sub-cells; scaled per size here). */\n backgroundImage: {\n isLead: \"[repeating-conic-gradient(var(--pv-ring-fill) 0% 25%, transparent 0% 50%)]\",\n },\n backgroundSize: {\n size: {\n S: \"[1px 1px]\",\n M: \"[1.5px 1.5px]\",\n L: \"[3px 3px]\",\n },\n },\n boxShadow: \"edge-glass\",\n animation: {\n isLit: {\n default: ringBlink,\n \"@media (prefers-reduced-motion: reduce)\": \"none\",\n },\n isIndeterminate: ringBlink,\n },\n animationDuration: {\n isLit: 2600,\n },\n animationTimingFunction: {\n isLit: \"[step-end]\",\n },\n animationIterationCount: {\n isLit: \"infinite\",\n },\n \"--pv-ring-fill\": {\n type: \"backgroundColor\",\n value: {\n default: \"accent\",\n isStaticColor: \"transparent-overlay-900\",\n forcedColors: \"ButtonText\",\n },\n },\n});\n\nconst centerStyles = style({\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n pointerEvents: \"none\",\n});\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n\nfunction safeRange(min: number, max: number): number {\n const range = max - min;\n return Number.isFinite(range) && range > 0 ? range : 1;\n}\n\nfunction getDataAttributes(source: object): JSX.HTMLAttributes<HTMLDivElement> {\n const record = source as Record<string, unknown>;\n const attributes: Record<string, string | undefined> = {};\n\n for (const key in record) {\n if (key.startsWith(\"data-\")) {\n const value = record[key];\n attributes[key] = value == null ? undefined : String(value);\n }\n }\n\n return attributes as JSX.HTMLAttributes<HTMLDivElement>;\n}\n\nexport function ProgressCircle(props: ProgressCircleProps): JSX.Element {\n const contextProps = getSlottedContextProps(useContext(ProgressCircleContext), props.slot);\n const merged = mergeProps(contextProps ?? {}, props) as ProgressCircleProps;\n const [local] = splitProps(merged, [\n \"value\",\n \"minValue\",\n \"maxValue\",\n \"isIndeterminate\",\n \"size\",\n \"staticColor\",\n \"children\",\n \"styles\",\n \"UNSAFE_className\",\n \"UNSAFE_style\",\n \"slot\",\n \"ref\",\n \"id\",\n \"aria-label\",\n \"aria-labelledby\",\n \"aria-describedby\",\n \"aria-details\",\n ]);\n const size = () => local.size ?? \"M\";\n const isIndeterminate = () => local.isIndeterminate ?? false;\n const isStaticColor = () => !!local.staticColor;\n const state = (): ProgressCircleStyleState => ({\n size: size(),\n staticColor: local.staticColor,\n isStaticColor: isStaticColor(),\n });\n const progressAria = createProgressBar({\n get id() {\n return local.id;\n },\n get value() {\n return local.value;\n },\n get minValue() {\n return local.minValue;\n },\n get maxValue() {\n return local.maxValue;\n },\n get isIndeterminate() {\n return isIndeterminate();\n },\n get \"aria-label\"() {\n return local[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return local[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return local[\"aria-describedby\"];\n },\n get \"aria-details\"() {\n return local[\"aria-details\"];\n },\n });\n const percentage = createMemo(() => {\n const minValue = local.minValue ?? 0;\n const maxValue = local.maxValue ?? 100;\n const value = clamp(local.value ?? 0, minValue, maxValue);\n return ((value - minValue) / safeRange(minValue, maxValue)) * 100;\n });\n /* Value → block quantization. Indeterminate lights the whole ring and lets the\n * staggered blink chase around it. The spec's hardcoded 10-lit/2-dithered split\n * is generalized: the last two lit blocks dither while the ring is partial\n * (work in flight has a leading edge; a full or empty ring has none). */\n const litCount = createMemo(() =>\n isIndeterminate()\n ? RING_COUNT\n : clamp(Math.round((percentage() / 100) * RING_COUNT), 0, RING_COUNT),\n );\n const geometry = () => RING_GEOMETRY[size()];\n const mergedStyles = () => mergeContextStyles(contextProps?.styles, props.styles);\n const mergedUnsafeStyle = () =>\n mergeContextUnsafeStyle(contextProps?.UNSAFE_style, props.UNSAFE_style);\n\n return (\n <div\n {...getDataAttributes(merged)}\n {...progressAria.progressBarProps}\n data-rac=\"\"\n ref={mergeContextRefs(\n (contextProps as { ref?: RefLike<HTMLDivElement> } | null)?.ref,\n props.ref,\n )}\n class={[local.UNSAFE_className, wrapperStyles(state(), mergedStyles())]\n .filter(Boolean)\n .join(\" \")}\n style={mergedUnsafeStyle()}\n slot={local.slot ?? undefined}\n >\n <For each={geometry().positions}>\n {(position, index) => {\n const isLit = () => index() < litCount();\n const isLead = () =>\n !isIndeterminate() &&\n litCount() > 0 &&\n litCount() < RING_COUNT &&\n isLit() &&\n index() >= litCount() - 2;\n return (\n <div\n aria-hidden=\"true\"\n class={blockStyles({\n ...state(),\n isLit: isLit(),\n isLead: isLead(),\n isIndeterminate: isIndeterminate(),\n })}\n style={{\n left: `${position.x}px`,\n top: `${position.y}px`,\n /* The spec's stagger: i × 0.16s inside the 2.6s loop. Inert when\n * the media gate zeroes the animation-name. */\n \"animation-delay\": isLit() ? `${(index() * 0.16).toFixed(2)}s` : undefined,\n }}\n />\n );\n }}\n </For>\n {/* Read `children` exactly once per run — a repeated getter read\n * re-instantiates the subtree and desyncs hydration keys. */}\n {(() => {\n const content = local.children;\n return content != null ? <div class={centerStyles}>{content}</div> : undefined;\n })()}\n </div>\n );\n}\n"],"mappings":";;;;AA+BA,MAAU,wBAA2B,cAAA,IAAA;AAiBb,MAAA,aAAA;AAQxB,SAAS,aAAa,WAAA,QAAA,OAAA;CACpB,OAAM;EACA;EACA,WAAW,MAAG,KAAM,EACpB,QAAY,WACZ,IAAA,GAAO,MAAI;GACV,MAAO,IAAO,IAAI,aAAS,KAAS,KAAA,IAAA,KAAA,KAAA;GAC7C,OAAA;;IAEa,GAAA,KAAA,MAAA,YAAwB,IAAA,SAAc,KAAA,IAAA,CAAA,IAAA,QAAqB,CAAA;;EAEnE,CAAA;CACH;AACF;AACA,MAAE,gBAAsB;CACvB,GAAA,aAAA,IAAA,GAAA,CAAA;;CAEG,GAAC,aAAA,IAAmB,IAAG,CAAA;AAC3B;AAQA,MAAG,gBAAmB,SAAS,UAAM,OAAW,WAAW;CACxD,IAAG,QAAO;CACV,IAAK,WAAS;CACd,IAAK,QAAO;CACf,IAAM,SAAW;;CAEjB,KAAS,IAAC,KAAA,SAAa;EACf,IAAC,EAAA,OAAM,MAAA,WAAA;EACb,IAAU,EAA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UAAA,MAAA;EACG,OAAM,WAAW,OAAA,CAAA,IAAA,OAAA,eAAA,QAAA,EAAA,OAAA,KAAA;CACrB,GAAE,EAAA;IACF,EAAC;AACL"}
|
|
@@ -116,7 +116,7 @@ const labelStyles = function anonymous(props) {
|
|
|
116
116
|
}
|
|
117
117
|
if (props.isStaticColor) rules += " pl151";
|
|
118
118
|
else if (props.isDisabled) rules += " pUvnvv151";
|
|
119
|
-
else rules += "
|
|
119
|
+
else rules += " pWQ7V3d151";
|
|
120
120
|
rules += " plb151";
|
|
121
121
|
rules += " ri151";
|
|
122
122
|
return rules;
|
|
@@ -160,7 +160,7 @@ const valueStyles = function anonymous(props) {
|
|
|
160
160
|
}
|
|
161
161
|
if (props.isStaticColor) rules += " pl151";
|
|
162
162
|
else if (props.isDisabled) rules += " pUvnvv151";
|
|
163
|
-
else rules += "
|
|
163
|
+
else rules += " pWQ7V3d151";
|
|
164
164
|
rules += " plb151";
|
|
165
165
|
rules += " ri151";
|
|
166
166
|
rules += " z8bmXs151";
|
|
@@ -222,7 +222,7 @@ const fillStyles = function anonymous(props) {
|
|
|
222
222
|
rules += " kd151";
|
|
223
223
|
rules += " jd151";
|
|
224
224
|
if (props.isStaticColor) rules += " gj151";
|
|
225
|
-
else rules += "
|
|
225
|
+
else rules += " gnhAeB151";
|
|
226
226
|
rules += " glc151";
|
|
227
227
|
if (props.isIndeterminate) rules += " _0e151";
|
|
228
228
|
return rules;
|
|
@@ -239,7 +239,7 @@ const pendingStyles = function anonymous(props) {
|
|
|
239
239
|
rules += " _iNW847b151";
|
|
240
240
|
rules += " __mrmLYsd151";
|
|
241
241
|
if (props.isStaticColor) rules += " -lMNcGb-gj151";
|
|
242
|
-
else rules += " -lMNcGb-
|
|
242
|
+
else rules += " -lMNcGb-gnhAeB151";
|
|
243
243
|
rules += " -lMNcGb-lgc151";
|
|
244
244
|
return rules;
|
|
245
245
|
};
|