@adobe/spectrum-wc-core 0.4.0-snapshot-test.20260714143259

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/README.md +39 -0
  2. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js +9 -0
  3. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/defineProperty.js +12 -0
  4. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/toPrimitive.js +14 -0
  5. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/toPropertyKey.js +9 -0
  6. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/typeof.js +11 -0
  7. package/dist/components/accordion/Accordion.base.d.ts +61 -0
  8. package/dist/components/accordion/Accordion.base.js +71 -0
  9. package/dist/components/accordion/Accordion.base.js.map +1 -0
  10. package/dist/components/accordion/Accordion.types.d.ts +22 -0
  11. package/dist/components/accordion/Accordion.types.js +21 -0
  12. package/dist/components/accordion/Accordion.types.js.map +1 -0
  13. package/dist/components/accordion/AccordionItem.base.d.ts +86 -0
  14. package/dist/components/accordion/AccordionItem.base.js +90 -0
  15. package/dist/components/accordion/AccordionItem.base.js.map +1 -0
  16. package/dist/components/accordion/index.d.ts +14 -0
  17. package/dist/components/accordion/index.js +4 -0
  18. package/dist/components/action-button/ActionButton.types.d.ts +15 -0
  19. package/dist/components/action-button/ActionButton.types.js +12 -0
  20. package/dist/components/action-button/ActionButton.types.js.map +1 -0
  21. package/dist/components/action-button/index.d.ts +12 -0
  22. package/dist/components/action-button/index.js +2 -0
  23. package/dist/components/alert-banner/AlertBanner.base.d.ts +36 -0
  24. package/dist/components/alert-banner/AlertBanner.base.js +56 -0
  25. package/dist/components/alert-banner/AlertBanner.base.js.map +1 -0
  26. package/dist/components/alert-banner/AlertBanner.types.d.ts +13 -0
  27. package/dist/components/alert-banner/AlertBanner.types.js +10 -0
  28. package/dist/components/alert-banner/AlertBanner.types.js.map +1 -0
  29. package/dist/components/alert-banner/index.d.ts +13 -0
  30. package/dist/components/alert-banner/index.js +3 -0
  31. package/dist/components/asset/Asset.base.d.ts +22 -0
  32. package/dist/components/asset/Asset.base.js +25 -0
  33. package/dist/components/asset/Asset.base.js.map +1 -0
  34. package/dist/components/asset/Asset.types.d.ts +13 -0
  35. package/dist/components/asset/Asset.types.js +6 -0
  36. package/dist/components/asset/Asset.types.js.map +1 -0
  37. package/dist/components/asset/index.d.ts +13 -0
  38. package/dist/components/asset/index.js +3 -0
  39. package/dist/components/avatar/Avatar.base.d.ts +53 -0
  40. package/dist/components/avatar/Avatar.base.js +56 -0
  41. package/dist/components/avatar/Avatar.base.js.map +1 -0
  42. package/dist/components/avatar/Avatar.types.d.ts +19 -0
  43. package/dist/components/avatar/Avatar.types.js +24 -0
  44. package/dist/components/avatar/Avatar.types.js.map +1 -0
  45. package/dist/components/avatar/index.d.ts +13 -0
  46. package/dist/components/avatar/index.js +3 -0
  47. package/dist/components/badge/Badge.base.d.ts +98 -0
  48. package/dist/components/badge/Badge.base.js +44 -0
  49. package/dist/components/badge/Badge.base.js.map +1 -0
  50. package/dist/components/badge/Badge.types.d.ts +21 -0
  51. package/dist/components/badge/Badge.types.js +43 -0
  52. package/dist/components/badge/Badge.types.js.map +1 -0
  53. package/dist/components/badge/index.d.ts +13 -0
  54. package/dist/components/badge/index.js +3 -0
  55. package/dist/components/button/Button.base.d.ts +99 -0
  56. package/dist/components/button/Button.base.js +75 -0
  57. package/dist/components/button/Button.base.js.map +1 -0
  58. package/dist/components/button/Button.types.d.ts +19 -0
  59. package/dist/components/button/Button.types.js +16 -0
  60. package/dist/components/button/Button.types.js.map +1 -0
  61. package/dist/components/button/index.d.ts +13 -0
  62. package/dist/components/button/index.js +3 -0
  63. package/dist/components/button-group/ButtonGroup.base.d.ts +89 -0
  64. package/dist/components/button-group/ButtonGroup.base.js +53 -0
  65. package/dist/components/button-group/ButtonGroup.base.js.map +1 -0
  66. package/dist/components/button-group/ButtonGroup.types.d.ts +17 -0
  67. package/dist/components/button-group/ButtonGroup.types.js +15 -0
  68. package/dist/components/button-group/ButtonGroup.types.js.map +1 -0
  69. package/dist/components/button-group/index.d.ts +13 -0
  70. package/dist/components/button-group/index.js +3 -0
  71. package/dist/components/card/Card.base.d.ts +123 -0
  72. package/dist/components/card/Card.base.js +75 -0
  73. package/dist/components/card/Card.base.js.map +1 -0
  74. package/dist/components/card/Card.types.d.ts +17 -0
  75. package/dist/components/card/Card.types.js +21 -0
  76. package/dist/components/card/Card.types.js.map +1 -0
  77. package/dist/components/card/index.d.ts +13 -0
  78. package/dist/components/card/index.js +3 -0
  79. package/dist/components/color-handle/ColorHandle.base.d.ts +51 -0
  80. package/dist/components/color-handle/ColorHandle.base.js +39 -0
  81. package/dist/components/color-handle/ColorHandle.base.js.map +1 -0
  82. package/dist/components/color-handle/ColorHandle.types.d.ts +30 -0
  83. package/dist/components/color-handle/color-contrast.d.ts +55 -0
  84. package/dist/components/color-handle/color-contrast.js +49 -0
  85. package/dist/components/color-handle/color-contrast.js.map +1 -0
  86. package/dist/components/color-handle/index.d.ts +14 -0
  87. package/dist/components/color-handle/index.js +3 -0
  88. package/dist/components/color-loupe/ColorLoupe.base.d.ts +26 -0
  89. package/dist/components/color-loupe/ColorLoupe.base.js +17 -0
  90. package/dist/components/color-loupe/ColorLoupe.base.js.map +1 -0
  91. package/dist/components/color-loupe/index.d.ts +12 -0
  92. package/dist/components/color-loupe/index.js +2 -0
  93. package/dist/components/divider/Divider.base.d.ts +43 -0
  94. package/dist/components/divider/Divider.base.js +37 -0
  95. package/dist/components/divider/Divider.base.js.map +1 -0
  96. package/dist/components/divider/Divider.types.d.ts +15 -0
  97. package/dist/components/divider/Divider.types.js +10 -0
  98. package/dist/components/divider/Divider.types.js.map +1 -0
  99. package/dist/components/divider/index.d.ts +13 -0
  100. package/dist/components/divider/index.js +3 -0
  101. package/dist/components/icon/Icon.base.d.ts +32 -0
  102. package/dist/components/icon/Icon.base.js +35 -0
  103. package/dist/components/icon/Icon.base.js.map +1 -0
  104. package/dist/components/icon/Icon.types.d.ts +13 -0
  105. package/dist/components/icon/Icon.types.js +12 -0
  106. package/dist/components/icon/Icon.types.js.map +1 -0
  107. package/dist/components/icon/index.d.ts +13 -0
  108. package/dist/components/icon/index.js +3 -0
  109. package/dist/components/illustrated-message/IllustratedMessage.base.d.ts +46 -0
  110. package/dist/components/illustrated-message/IllustratedMessage.base.js +46 -0
  111. package/dist/components/illustrated-message/IllustratedMessage.base.js.map +1 -0
  112. package/dist/components/illustrated-message/IllustratedMessage.types.d.ts +15 -0
  113. package/dist/components/illustrated-message/IllustratedMessage.types.js +10 -0
  114. package/dist/components/illustrated-message/IllustratedMessage.types.js.map +1 -0
  115. package/dist/components/illustrated-message/index.d.ts +13 -0
  116. package/dist/components/illustrated-message/index.js +3 -0
  117. package/dist/components/meter/Meter.base.d.ts +40 -0
  118. package/dist/components/meter/Meter.base.js +30 -0
  119. package/dist/components/meter/Meter.base.js.map +1 -0
  120. package/dist/components/meter/Meter.types.d.ts +13 -0
  121. package/dist/components/meter/Meter.types.js +11 -0
  122. package/dist/components/meter/Meter.types.js.map +1 -0
  123. package/dist/components/meter/index.d.ts +13 -0
  124. package/dist/components/meter/index.js +3 -0
  125. package/dist/components/popover/Popover.base.d.ts +223 -0
  126. package/dist/components/popover/Popover.base.js +270 -0
  127. package/dist/components/popover/Popover.base.js.map +1 -0
  128. package/dist/components/popover/Popover.types.d.ts +39 -0
  129. package/dist/components/popover/Popover.types.js +24 -0
  130. package/dist/components/popover/Popover.types.js.map +1 -0
  131. package/dist/components/popover/index.d.ts +13 -0
  132. package/dist/components/popover/index.js +3 -0
  133. package/dist/components/progress-circle/ProgressCircle.base.d.ts +91 -0
  134. package/dist/components/progress-circle/ProgressCircle.base.js +73 -0
  135. package/dist/components/progress-circle/ProgressCircle.base.js.map +1 -0
  136. package/dist/components/progress-circle/ProgressCircle.types.d.ts +15 -0
  137. package/dist/components/progress-circle/ProgressCircle.types.js +10 -0
  138. package/dist/components/progress-circle/ProgressCircle.types.js.map +1 -0
  139. package/dist/components/progress-circle/index.d.ts +13 -0
  140. package/dist/components/progress-circle/index.js +3 -0
  141. package/dist/components/status-light/StatusLight.base.d.ts +65 -0
  142. package/dist/components/status-light/StatusLight.base.js +29 -0
  143. package/dist/components/status-light/StatusLight.base.js.map +1 -0
  144. package/dist/components/status-light/StatusLight.types.d.ts +19 -0
  145. package/dist/components/status-light/StatusLight.types.js +32 -0
  146. package/dist/components/status-light/StatusLight.types.js.map +1 -0
  147. package/dist/components/status-light/index.d.ts +13 -0
  148. package/dist/components/status-light/index.js +3 -0
  149. package/dist/components/tabs/Tab.base.d.ts +49 -0
  150. package/dist/components/tabs/Tab.base.js +39 -0
  151. package/dist/components/tabs/Tab.base.js.map +1 -0
  152. package/dist/components/tabs/Tab.types.d.ts +17 -0
  153. package/dist/components/tabs/TabPanel.base.d.ts +49 -0
  154. package/dist/components/tabs/TabPanel.base.js +36 -0
  155. package/dist/components/tabs/TabPanel.base.js.map +1 -0
  156. package/dist/components/tabs/TabPanel.types.d.ts +17 -0
  157. package/dist/components/tabs/Tabs.base.d.ts +235 -0
  158. package/dist/components/tabs/Tabs.base.js +225 -0
  159. package/dist/components/tabs/Tabs.base.js.map +1 -0
  160. package/dist/components/tabs/Tabs.types.d.ts +55 -0
  161. package/dist/components/tabs/Tabs.types.js +6 -0
  162. package/dist/components/tabs/Tabs.types.js.map +1 -0
  163. package/dist/components/tabs/index.d.ts +17 -0
  164. package/dist/components/tabs/index.js +5 -0
  165. package/dist/components/tooltip/Tooltip.base.d.ts +154 -0
  166. package/dist/components/tooltip/Tooltip.base.js +163 -0
  167. package/dist/components/tooltip/Tooltip.base.js.map +1 -0
  168. package/dist/components/tooltip/Tooltip.types.d.ts +18 -0
  169. package/dist/components/tooltip/Tooltip.types.js +15 -0
  170. package/dist/components/tooltip/Tooltip.types.js.map +1 -0
  171. package/dist/components/tooltip/index.d.ts +13 -0
  172. package/dist/components/tooltip/index.js +3 -0
  173. package/dist/controllers/color-controller/index.d.ts +12 -0
  174. package/dist/controllers/color-controller/index.js +1 -0
  175. package/dist/controllers/color-controller/src/color-controller.d.ts +226 -0
  176. package/dist/controllers/color-controller/src/color-controller.js +252 -0
  177. package/dist/controllers/color-controller/src/color-controller.js.map +1 -0
  178. package/dist/controllers/focusgroup-navigation-controller/index.d.ts +12 -0
  179. package/dist/controllers/focusgroup-navigation-controller/src/focusgroup-navigation-controller.d.ts +477 -0
  180. package/dist/controllers/focusgroup-navigation-controller/src/focusgroup-navigation-controller.js +342 -0
  181. package/dist/controllers/focusgroup-navigation-controller/src/focusgroup-navigation-controller.js.map +1 -0
  182. package/dist/controllers/hover-controller/index.d.ts +12 -0
  183. package/dist/controllers/hover-controller/src/hover-controller.d.ts +118 -0
  184. package/dist/controllers/hover-controller/src/hover-controller.js +90 -0
  185. package/dist/controllers/hover-controller/src/hover-controller.js.map +1 -0
  186. package/dist/controllers/index.d.ts +20 -0
  187. package/dist/controllers/index.js +11 -0
  188. package/dist/controllers/language-resolution.d.ts +87 -0
  189. package/dist/controllers/language-resolution.js +56 -0
  190. package/dist/controllers/language-resolution.js.map +1 -0
  191. package/dist/controllers/page-scroll-lock.d.ts +20 -0
  192. package/dist/controllers/page-scroll-lock.js +30 -0
  193. package/dist/controllers/page-scroll-lock.js.map +1 -0
  194. package/dist/controllers/placement-controller/index.d.ts +12 -0
  195. package/dist/controllers/placement-controller/index.js +3 -0
  196. package/dist/controllers/placement-controller/src/fallback-placements.d.ts +9 -0
  197. package/dist/controllers/placement-controller/src/fallback-placements.js +71 -0
  198. package/dist/controllers/placement-controller/src/fallback-placements.js.map +1 -0
  199. package/dist/controllers/placement-controller/src/placement-controller.d.ts +152 -0
  200. package/dist/controllers/placement-controller/src/placement-controller.js +129 -0
  201. package/dist/controllers/placement-controller/src/placement-controller.js.map +1 -0
  202. package/dist/controllers/placement-controller/src/placement-conversion.d.ts +35 -0
  203. package/dist/controllers/placement-controller/src/placement-conversion.js +54 -0
  204. package/dist/controllers/placement-controller/src/placement-conversion.js.map +1 -0
  205. package/dist/controllers/placement-controller/src/types.d.ts +128 -0
  206. package/dist/controllers/placement-controller/src/types.js +29 -0
  207. package/dist/controllers/placement-controller/src/types.js.map +1 -0
  208. package/dist/controllers/slot-attribute-propagation/index.d.ts +12 -0
  209. package/dist/controllers/slot-attribute-propagation/src/slot-attribute-propagation-controller.d.ts +55 -0
  210. package/dist/controllers/slot-attribute-propagation/src/slot-attribute-propagation-controller.js +32 -0
  211. package/dist/controllers/slot-attribute-propagation/src/slot-attribute-propagation-controller.js.map +1 -0
  212. package/dist/element/define-element.d.ts +16 -0
  213. package/dist/element/define-element.js +8 -0
  214. package/dist/element/define-element.js.map +1 -0
  215. package/dist/element/index.d.ts +14 -0
  216. package/dist/element/index.js +4 -0
  217. package/dist/element/spectrum-element.d.ts +26 -0
  218. package/dist/element/spectrum-element.js +66 -0
  219. package/dist/element/spectrum-element.js.map +1 -0
  220. package/dist/element/version.d.ts +19 -0
  221. package/dist/element/version.js +6 -0
  222. package/dist/element/version.js.map +1 -0
  223. package/dist/mixins/disabled-mixin.d.ts +30 -0
  224. package/dist/mixins/disabled-mixin.js +27 -0
  225. package/dist/mixins/disabled-mixin.js.map +1 -0
  226. package/dist/mixins/index.d.ts +17 -0
  227. package/dist/mixins/index.js +6 -0
  228. package/dist/mixins/linear-progress-mixin.d.ts +42 -0
  229. package/dist/mixins/linear-progress-mixin.js +111 -0
  230. package/dist/mixins/linear-progress-mixin.js.map +1 -0
  231. package/dist/mixins/observe-slot-presence.d.ts +12 -0
  232. package/dist/mixins/observe-slot-presence.js +40 -0
  233. package/dist/mixins/observe-slot-presence.js.map +1 -0
  234. package/dist/mixins/observe-slot-text.d.ts +11 -0
  235. package/dist/mixins/observe-slot-text.js +60 -0
  236. package/dist/mixins/observe-slot-text.js.map +1 -0
  237. package/dist/mixins/sized-mixin.d.ts +21 -0
  238. package/dist/mixins/sized-mixin.js +42 -0
  239. package/dist/mixins/sized-mixin.js.map +1 -0
  240. package/dist/utils/actual-placement.d.ts +10 -0
  241. package/dist/utils/actual-placement.js +8 -0
  242. package/dist/utils/actual-placement.js.map +1 -0
  243. package/dist/utils/capitalize.d.ts +26 -0
  244. package/dist/utils/capitalize.js +8 -0
  245. package/dist/utils/capitalize.js.map +1 -0
  246. package/dist/utils/deep-contains.d.ts +26 -0
  247. package/dist/utils/deep-contains.js +14 -0
  248. package/dist/utils/deep-contains.js.map +1 -0
  249. package/dist/utils/dismissible-stack.d.ts +26 -0
  250. package/dist/utils/dismissible-stack.js +16 -0
  251. package/dist/utils/dismissible-stack.js.map +1 -0
  252. package/dist/utils/focusable-selectors.d.ts +43 -0
  253. package/dist/utils/focusable-selectors.js +18 -0
  254. package/dist/utils/focusable-selectors.js.map +1 -0
  255. package/dist/utils/get-active-element.d.ts +31 -0
  256. package/dist/utils/get-active-element.js +11 -0
  257. package/dist/utils/get-active-element.js.map +1 -0
  258. package/dist/utils/get-label-from-slot.d.ts +12 -0
  259. package/dist/utils/get-label-from-slot.js +10 -0
  260. package/dist/utils/get-label-from-slot.js.map +1 -0
  261. package/dist/utils/index.d.ts +20 -0
  262. package/dist/utils/index.js +10 -0
  263. package/dist/utils/resolve-trigger.d.ts +42 -0
  264. package/dist/utils/resolve-trigger.js +23 -0
  265. package/dist/utils/resolve-trigger.js.map +1 -0
  266. package/dist/utils/transition.d.ts +53 -0
  267. package/dist/utils/transition.js +26 -0
  268. package/dist/utils/transition.js.map +1 -0
  269. package/package.json +400 -0
@@ -0,0 +1,123 @@
1
+ import { PropertyValues } from 'lit';
2
+ import { SpectrumElement } from '../../element/index.js';
3
+ import { CardDensity, CardVariant } from './Card.types.js';
4
+ declare const CardBase_base: typeof SpectrumElement & {
5
+ new (...args: any[]): import('../../mixins/index.js').SizedElementInterface;
6
+ prototype: import('../../mixins/index.js').SizedElementInterface;
7
+ } & import('../../mixins/index.js').SizedElementConstructor;
8
+ /**
9
+ * Abstract base class for all card-family components. Owns the semantics
10
+ * shared across every card type: sizing, visual variant, and density.
11
+ *
12
+ * `swc-card`, `swc-user-card`, and `swc-product-card` each extend this base
13
+ * directly and render the shared anatomy via `renderCardTemplate()` in
14
+ * `swc/components/card/card-template.ts`. That template also carries a
15
+ * collection placeholder and an avatar/thumbnail glyph, each supplied
16
+ * per-component via `renderCollection`/`renderGlyph`.
17
+ *
18
+ * @attribute {ElementSize} size - The size of the card.
19
+ *
20
+ * @slot preview - Primary preview content
21
+ * @slot title - Card title
22
+ * @slot actions - Optional action controls
23
+ * @slot description - Supporting description text
24
+ * @slot footer - Optional footer content
25
+ * @slot - Additional body content
26
+ */
27
+ export declare abstract class CardBase extends CardBase_base {
28
+ /**
29
+ * @internal
30
+ */
31
+ static readonly VARIANTS: readonly CardVariant[];
32
+ /**
33
+ * @internal
34
+ */
35
+ static readonly DENSITIES: readonly CardDensity[];
36
+ /**
37
+ * The visual variant of the card.
38
+ *
39
+ * @default primary
40
+ */
41
+ variant: CardVariant;
42
+ /**
43
+ * The density of the card, controlling internal spacing and gaps.
44
+ *
45
+ * @default regular
46
+ */
47
+ density: CardDensity;
48
+ /**
49
+ * Indicates the consumer has wrapped their `title` slot content in a real
50
+ * link. Extends that link's hit area to cover the card surface while
51
+ * leaving navigation entirely consumer-owned — Card accepts no `href`.
52
+ *
53
+ * @todo Naming, and the `::slotted(a)::after` vs. click-proxy mechanism,
54
+ * are still open. See the card family plan, A11y-3 / Q2.
55
+ */
56
+ titleAsLink: boolean;
57
+ /**
58
+ * Makes the card focusable and captures surface clicks (excluding nested
59
+ * interactive targets) to dispatch a `swc-card-click` event, independent
60
+ * of `titleAsLink`. Lays groundwork for a future `CardView` selection
61
+ * model without Card owning selected-state UI itself.
62
+ *
63
+ * @todo Event name and `tabindex` management details are still open. See
64
+ * the card family plan, A11y-3 / Q3.
65
+ * @todo No `role` is set when `selectable` is true — deferred rather than
66
+ * defaulting to `role="button"`, since the eventual `CardView` selection
67
+ * model may call for a different role (e.g. `option`/`gridcell`) that
68
+ * `role="button"` would be wrong to have committed to today. See the card
69
+ * family plan, A11y-3 / Q8.
70
+ */
71
+ selectable: boolean;
72
+ connectedCallback(): void;
73
+ disconnectedCallback(): void;
74
+ protected updated(changedProperties: PropertyValues): void;
75
+ /**
76
+ * @internal
77
+ * The card's own `title` slot element, or `null` before the concrete
78
+ * class's `renderCardTemplate()` call has rendered.
79
+ */
80
+ protected getTitleSlotElement(): HTMLSlotElement | null;
81
+ /**
82
+ * @internal
83
+ * The `title` slot's link, supporting both forms consumers reasonably
84
+ * use: the assigned element itself is the anchor (`<a slot="title"
85
+ * href="...">`), or the anchor is nested inside a wrapper (`<span
86
+ * slot="title"><a href="...">`). Requires `href` — a link with no
87
+ * destination can't usefully be clicked-through.
88
+ */
89
+ protected getTitleLinkElement(): HTMLAnchorElement | null;
90
+ /**
91
+ * @internal
92
+ * Whether `node` provides its own interaction/focus semantics. Checking
93
+ * the `tabIndex` IDL property (rather than the `tabindex` attribute or a
94
+ * tag-name list) correctly covers natively-interactive elements
95
+ * (`button`, `input`, `select`, `textarea`, `a[href]`) with no explicit
96
+ * attribute, excludes `tabindex="-1"` (focusable for scripting, not a
97
+ * click target) and disabled controls, and works for a custom element's
98
+ * internal shadow-DOM control too — `composedPath()` already traverses
99
+ * into other elements' shadow roots for composed events like `click`, so
100
+ * an internal `<button>` inside e.g. `<swc-button>` is inspected directly
101
+ * regardless of which shadow tree it belongs to.
102
+ */
103
+ private static isFocusable;
104
+ /**
105
+ * Proxies a qualifying surface click to `titleAsLink`'s link and/or
106
+ * dispatches `swc-card-click` for `selectable`, after filtering out
107
+ * clicks that landed on a nested interactive target (see `isFocusable()`
108
+ * and the `actions`-slot exclusion above).
109
+ */
110
+ protected readonly handleSurfaceClick: (event: Event) => void;
111
+ /**
112
+ * `tabindex` is only ever added alongside this listener (see `updated()`)
113
+ * and removed alongside its removal — a focusable card is never left
114
+ * without keyboard activation. Enter and Space are treated identically
115
+ * and both proxy to `titleAsLink`'s link when set, even though a bare
116
+ * link conventionally responds to Enter only: the card's own activation
117
+ * contract (Enter+Space, more button-like) is authoritative once
118
+ * `selectable` makes the card itself the focused target, regardless of
119
+ * what that activation happens to proxy to.
120
+ */
121
+ protected readonly handleSelectableKeydown: (event: KeyboardEvent) => void;
122
+ }
123
+ export {};
@@ -0,0 +1,75 @@
1
+ import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
2
+ import { CARD_DENSITIES as t, CARD_VALID_SIZES as n, CARD_VARIANTS as r } from "./Card.types.js";
3
+ import { property as i } from "lit/decorators.js";
4
+ import { SpectrumElement as a } from "@adobe/spectrum-wc-core/element/index.js";
5
+ import { SizedMixin as o } from "@adobe/spectrum-wc-core/mixins/index.js";
6
+ //#region components/card/Card.base.ts
7
+ var s, c = class e extends o(a, { validSizes: n }) {
8
+ constructor(...t) {
9
+ super(...t), this.variant = "primary", this.density = "regular", this.titleAsLink = !1, this.selectable = !1, this.handleSurfaceClick = (t) => {
10
+ var n;
11
+ if (!this.titleAsLink && !this.selectable) return;
12
+ let r = t.composedPath(), i = r.slice(0, r.indexOf(this)), a = (n = this.renderRoot) == null ? void 0 : n.querySelector("slot[name=\"actions\"]");
13
+ if (!(a && i.includes(a) || i.some(e.isFocusable))) {
14
+ if (this.titleAsLink) {
15
+ var o;
16
+ (o = this.getTitleLinkElement()) == null || o.click();
17
+ }
18
+ this.selectable && this.dispatchEvent(new Event("swc-card-click", {
19
+ bubbles: !0,
20
+ composed: !0
21
+ }));
22
+ }
23
+ }, this.handleSelectableKeydown = (e) => {
24
+ (e.code === "Enter" || e.code === "Space") && (e.preventDefault(), this.handleSurfaceClick(e));
25
+ };
26
+ }
27
+ connectedCallback() {
28
+ super.connectedCallback(), this.addEventListener("click", this.handleSurfaceClick);
29
+ }
30
+ disconnectedCallback() {
31
+ this.removeEventListener("click", this.handleSurfaceClick), this.removeEventListener("keydown", this.handleSelectableKeydown), super.disconnectedCallback();
32
+ }
33
+ updated(e) {
34
+ var t;
35
+ if (super.updated(e), e.has("selectable") && (this.selectable ? (this.setAttribute("tabindex", "0"), this.addEventListener("keydown", this.handleSelectableKeydown)) : (this.removeAttribute("tabindex"), this.removeEventListener("keydown", this.handleSelectableKeydown))), (t = window.__swc) != null && t.DEBUG) {
36
+ let { VARIANTS: t, DENSITIES: n } = this.constructor;
37
+ e.has("variant") && !t.includes(this.variant) && window.__swc.warn(this, `<${this.localName}> received an invalid "variant" value of "${this.variant}". Valid values are ${t.join(", ")}.`, "https://opensource.adobe.com/spectrum-web-components/components/card/", { issues: [`variant="${this.variant}"`] }), e.has("density") && !n.includes(this.density) && window.__swc.warn(this, `<${this.localName}> received an invalid "density" value of "${this.density}". Valid values are ${n.join(", ")}.`, "https://opensource.adobe.com/spectrum-web-components/components/card/", { issues: [`density="${this.density}"`] }), e.has("titleAsLink") && this.titleAsLink && !this.getTitleLinkElement() && window.__swc.warn(this, `<${this.localName}> has "title-as-link" set but no link element was found in the "title" slot.`, "https://opensource.adobe.com/spectrum-web-components/components/card/", { issues: ["title-as-link"] });
38
+ }
39
+ }
40
+ getTitleSlotElement() {
41
+ var e, t;
42
+ return (e = (t = this.renderRoot) == null ? void 0 : t.querySelector("slot[name=\"title\"]")) == null ? null : e;
43
+ }
44
+ getTitleLinkElement() {
45
+ var e;
46
+ let t = (e = this.getTitleSlotElement()) == null ? void 0 : e.assignedElements({ flatten: !0 });
47
+ for (let e of t == null ? [] : t) {
48
+ if (e instanceof HTMLAnchorElement && e.href) return e;
49
+ let t = e.querySelector("a[href]");
50
+ if (t) return t;
51
+ }
52
+ return null;
53
+ }
54
+ static isFocusable(e) {
55
+ return e instanceof HTMLElement && e.tabIndex >= 0;
56
+ }
57
+ };
58
+ s = c, s.VARIANTS = r, s.DENSITIES = t, e([i({
59
+ type: String,
60
+ reflect: !0
61
+ })], c.prototype, "variant", void 0), e([i({
62
+ type: String,
63
+ reflect: !0
64
+ })], c.prototype, "density", void 0), e([i({
65
+ type: Boolean,
66
+ reflect: !0,
67
+ attribute: "title-as-link"
68
+ })], c.prototype, "titleAsLink", void 0), e([i({
69
+ type: Boolean,
70
+ reflect: !0
71
+ })], c.prototype, "selectable", void 0);
72
+ //#endregion
73
+ export { c as CardBase };
74
+
75
+ //# sourceMappingURL=Card.base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Card.base.js","names":[],"sources":["../../../components/card/Card.base.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { PropertyValues } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\nimport { SizedMixin } from '@adobe/spectrum-wc-core/mixins/index.js';\n\nimport {\n CARD_DENSITIES,\n CARD_VALID_SIZES,\n CARD_VARIANTS,\n type CardDensity,\n type CardVariant,\n} from './Card.types.js';\n\n/**\n * Abstract base class for all card-family components. Owns the semantics\n * shared across every card type: sizing, visual variant, and density.\n *\n * `swc-card`, `swc-user-card`, and `swc-product-card` each extend this base\n * directly and render the shared anatomy via `renderCardTemplate()` in\n * `swc/components/card/card-template.ts`. That template also carries a\n * collection placeholder and an avatar/thumbnail glyph, each supplied\n * per-component via `renderCollection`/`renderGlyph`.\n *\n * @attribute {ElementSize} size - The size of the card.\n *\n * @slot preview - Primary preview content\n * @slot title - Card title\n * @slot actions - Optional action controls\n * @slot description - Supporting description text\n * @slot footer - Optional footer content\n * @slot - Additional body content\n */\nexport abstract class CardBase extends SizedMixin(SpectrumElement, {\n validSizes: CARD_VALID_SIZES,\n}) {\n // ─────────────────────────\n // API TO OVERRIDE\n // ─────────────────────────\n\n /**\n * @internal\n */\n static readonly VARIANTS: readonly CardVariant[] = CARD_VARIANTS;\n\n /**\n * @internal\n */\n static readonly DENSITIES: readonly CardDensity[] = CARD_DENSITIES;\n\n // ──────────────────\n // SHARED API\n // ──────────────────\n\n /**\n * The visual variant of the card.\n *\n * @default primary\n */\n @property({ type: String, reflect: true })\n public variant: CardVariant = 'primary';\n\n /**\n * The density of the card, controlling internal spacing and gaps.\n *\n * @default regular\n */\n @property({ type: String, reflect: true })\n public density: CardDensity = 'regular';\n\n /**\n * Indicates the consumer has wrapped their `title` slot content in a real\n * link. Extends that link's hit area to cover the card surface while\n * leaving navigation entirely consumer-owned — Card accepts no `href`.\n *\n * @todo Naming, and the `::slotted(a)::after` vs. click-proxy mechanism,\n * are still open. See the card family plan, A11y-3 / Q2.\n */\n @property({ type: Boolean, reflect: true, attribute: 'title-as-link' })\n public titleAsLink = false;\n\n /**\n * Makes the card focusable and captures surface clicks (excluding nested\n * interactive targets) to dispatch a `swc-card-click` event, independent\n * of `titleAsLink`. Lays groundwork for a future `CardView` selection\n * model without Card owning selected-state UI itself.\n *\n * @todo Event name and `tabindex` management details are still open. See\n * the card family plan, A11y-3 / Q3.\n * @todo No `role` is set when `selectable` is true — deferred rather than\n * defaulting to `role=\"button\"`, since the eventual `CardView` selection\n * model may call for a different role (e.g. `option`/`gridcell`) that\n * `role=\"button\"` would be wrong to have committed to today. See the card\n * family plan, A11y-3 / Q8.\n */\n @property({ type: Boolean, reflect: true })\n public selectable = false;\n\n // ──────────────────────\n // IMPLEMENTATION\n // ──────────────────────\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener('click', this.handleSurfaceClick);\n }\n\n public override disconnectedCallback(): void {\n this.removeEventListener('click', this.handleSurfaceClick);\n this.removeEventListener('keydown', this.handleSelectableKeydown);\n super.disconnectedCallback();\n }\n\n protected override updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n\n if (changedProperties.has('selectable')) {\n if (this.selectable) {\n this.setAttribute('tabindex', '0');\n this.addEventListener('keydown', this.handleSelectableKeydown);\n } else {\n this.removeAttribute('tabindex');\n this.removeEventListener('keydown', this.handleSelectableKeydown);\n }\n }\n\n if (window.__swc?.DEBUG) {\n const { VARIANTS, DENSITIES } = this.constructor as typeof CardBase;\n\n if (\n changedProperties.has('variant') &&\n !VARIANTS.includes(this.variant)\n ) {\n window.__swc.warn(\n this,\n `<${this.localName}> received an invalid \"variant\" value of \"${this.variant}\". Valid values are ${VARIANTS.join(', ')}.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/card/',\n { issues: [`variant=\"${this.variant}\"`] }\n );\n }\n\n if (\n changedProperties.has('density') &&\n !DENSITIES.includes(this.density)\n ) {\n window.__swc.warn(\n this,\n `<${this.localName}> received an invalid \"density\" value of \"${this.density}\". Valid values are ${DENSITIES.join(', ')}.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/card/',\n { issues: [`density=\"${this.density}\"`] }\n );\n }\n\n if (\n changedProperties.has('titleAsLink') &&\n this.titleAsLink &&\n !this.getTitleLinkElement()\n ) {\n window.__swc.warn(\n this,\n `<${this.localName}> has \"title-as-link\" set but no link element was found in the \"title\" slot.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/card/',\n { issues: ['title-as-link'] }\n );\n }\n }\n }\n\n /**\n * @internal\n * The card's own `title` slot element, or `null` before the concrete\n * class's `renderCardTemplate()` call has rendered.\n */\n protected getTitleSlotElement(): HTMLSlotElement | null {\n return this.renderRoot?.querySelector('slot[name=\"title\"]') ?? null;\n }\n\n /**\n * @internal\n * The `title` slot's link, supporting both forms consumers reasonably\n * use: the assigned element itself is the anchor (`<a slot=\"title\"\n * href=\"...\">`), or the anchor is nested inside a wrapper (`<span\n * slot=\"title\"><a href=\"...\">`). Requires `href` — a link with no\n * destination can't usefully be clicked-through.\n */\n protected getTitleLinkElement(): HTMLAnchorElement | null {\n const assigned = this.getTitleSlotElement()?.assignedElements({\n flatten: true,\n });\n for (const element of assigned ?? []) {\n if (element instanceof HTMLAnchorElement && element.href) {\n return element;\n }\n const nested = element.querySelector<HTMLAnchorElement>('a[href]');\n if (nested) {\n return nested;\n }\n }\n return null;\n }\n\n /**\n * @internal\n * Whether `node` provides its own interaction/focus semantics. Checking\n * the `tabIndex` IDL property (rather than the `tabindex` attribute or a\n * tag-name list) correctly covers natively-interactive elements\n * (`button`, `input`, `select`, `textarea`, `a[href]`) with no explicit\n * attribute, excludes `tabindex=\"-1\"` (focusable for scripting, not a\n * click target) and disabled controls, and works for a custom element's\n * internal shadow-DOM control too — `composedPath()` already traverses\n * into other elements' shadow roots for composed events like `click`, so\n * an internal `<button>` inside e.g. `<swc-button>` is inspected directly\n * regardless of which shadow tree it belongs to.\n */\n private static isFocusable(node: EventTarget): boolean {\n return node instanceof HTMLElement && node.tabIndex >= 0;\n }\n\n /**\n * Proxies a qualifying surface click to `titleAsLink`'s link and/or\n * dispatches `swc-card-click` for `selectable`, after filtering out\n * clicks that landed on a nested interactive target (see `isFocusable()`\n * and the `actions`-slot exclusion above).\n */\n protected readonly handleSurfaceClick = (event: Event): void => {\n if (!this.titleAsLink && !this.selectable) {\n return;\n }\n const path = event.composedPath();\n const precedingPath = path.slice(0, path.indexOf(this));\n const actionsSlot = this.renderRoot?.querySelector('slot[name=\"actions\"]');\n const hitInteractiveTarget =\n // The `actions` slot is unconditionally excluded, defense-in-depth,\n // since it's contractually for interactive content regardless of\n // whether a given control correctly reflects focusability.\n (actionsSlot && precedingPath.includes(actionsSlot)) ||\n precedingPath.some(CardBase.isFocusable);\n if (hitInteractiveTarget) {\n return;\n }\n if (this.titleAsLink) {\n this.getTitleLinkElement()?.click();\n }\n if (this.selectable) {\n this.dispatchEvent(\n new Event('swc-card-click', { bubbles: true, composed: true })\n );\n }\n };\n\n /**\n * `tabindex` is only ever added alongside this listener (see `updated()`)\n * and removed alongside its removal — a focusable card is never left\n * without keyboard activation. Enter and Space are treated identically\n * and both proxy to `titleAsLink`'s link when set, even though a bare\n * link conventionally responds to Enter only: the card's own activation\n * contract (Enter+Space, more button-like) is authoritative once\n * `selectable` makes the card itself the focused target, regardless of\n * what that activation happens to proxy to.\n */\n protected readonly handleSelectableKeydown = (event: KeyboardEvent): void => {\n if (event.code === 'Enter' || event.code === 'Space') {\n event.preventDefault();\n this.handleSurfaceClick(event);\n }\n };\n}\n"],"mappings":";;;;;;OA6CsB,IAAtB,MAAsB,UAAiB,EAAW,GAAiB,EACjE,YAAY,GACb,CAAC,CAAC;;8BAyB6B,0BAQA,8BAWT,sBAiBD,+BAgIqB,MAAuB;;AAC9D,OAAI,CAAC,KAAK,eAAe,CAAC,KAAK,WAC7B;GAEF,IAAM,IAAO,EAAM,cAAc,EAC3B,IAAgB,EAAK,MAAM,GAAG,EAAK,QAAQ,KAAK,CAAC,EACjD,KAAA,IAAc,KAAK,eAAA,OAAA,KAAA,IAAA,EAAY,cAAc,yBAAuB;AAKvE,cAAe,EAAc,SAAS,EAAY,IACnD,EAAc,KAAK,EAAS,YAAY,GAI1C;QAAI,KAAK,aAAa;;AACpB,MAAA,IAAA,KAAK,qBAAqB,KAAA,QAAA,EAAE,OAAO;;AAErC,IAAI,KAAK,cACP,KAAK,cACH,IAAI,MAAM,kBAAkB;KAAE,SAAS;KAAM,UAAU;KAAM,CAAC,CAC/D;;qCAcyC,MAA+B;AAC3E,IAAI,EAAM,SAAS,WAAW,EAAM,SAAS,aAC3C,EAAM,gBAAgB,EACtB,KAAK,mBAAmB,EAAM;;;CAjKlC,oBAA0C;AAExC,EADA,MAAM,mBAAmB,EACzB,KAAK,iBAAiB,SAAS,KAAK,mBAAmB;;CAGzD,uBAA6C;AAG3C,EAFA,KAAK,oBAAoB,SAAS,KAAK,mBAAmB,EAC1D,KAAK,oBAAoB,WAAW,KAAK,wBAAwB,EACjE,MAAM,sBAAsB;;CAG9B,QAA2B,GAAyC;;AAalE,MAZA,MAAM,QAAQ,EAAkB,EAE5B,EAAkB,IAAI,aAAa,KACjC,KAAK,cACP,KAAK,aAAa,YAAY,IAAI,EAClC,KAAK,iBAAiB,WAAW,KAAK,wBAAwB,KAE9D,KAAK,gBAAgB,WAAW,EAChC,KAAK,oBAAoB,WAAW,KAAK,wBAAwB,KAIrE,IAAI,OAAO,UAAA,QAAA,EAAO,OAAO;GACvB,IAAM,EAAE,aAAU,iBAAc,KAAK;AA0BrC,GAvBE,EAAkB,IAAI,UAAU,IAChC,CAAC,EAAS,SAAS,KAAK,QAAQ,IAEhC,OAAO,MAAM,KACX,MACA,IAAI,KAAK,UAAU,4CAA4C,KAAK,QAAQ,sBAAsB,EAAS,KAAK,KAAK,CAAC,IACtH,yEACA,EAAE,QAAQ,CAAC,YAAY,KAAK,QAAQ,GAAG,EAAE,CAC1C,EAID,EAAkB,IAAI,UAAU,IAChC,CAAC,EAAU,SAAS,KAAK,QAAQ,IAEjC,OAAO,MAAM,KACX,MACA,IAAI,KAAK,UAAU,4CAA4C,KAAK,QAAQ,sBAAsB,EAAU,KAAK,KAAK,CAAC,IACvH,yEACA,EAAE,QAAQ,CAAC,YAAY,KAAK,QAAQ,GAAG,EAAE,CAC1C,EAID,EAAkB,IAAI,cAAc,IACpC,KAAK,eACL,CAAC,KAAK,qBAAqB,IAE3B,OAAO,MAAM,KACX,MACA,IAAI,KAAK,UAAU,+EACnB,yEACA,EAAE,QAAQ,CAAC,gBAAgB,EAAE,CAC9B;;;CAUP,sBAAwD;;AACtD,UAAA,KAAA,IAAO,KAAK,eAAA,OAAA,KAAA,IAAA,EAAY,cAAc,uBAAqB,KAAA,OAAI,OAAJ;;CAW7D,sBAA0D;;EACxD,IAAM,KAAA,IAAW,KAAK,qBAAqB,KAAA,OAAA,KAAA,IAAA,EAAE,iBAAiB,EAC5D,SAAS,IACV,CAAC;AACF,OAAK,IAAM,KAAW,KAAA,OAAY,EAAE,GAAd,GAAgB;AACpC,OAAI,aAAmB,qBAAqB,EAAQ,KAClD,QAAO;GAET,IAAM,IAAS,EAAQ,cAAiC,UAAU;AAClE,OAAI,EACF,QAAO;;AAGX,SAAO;;CAgBT,OAAe,YAAY,GAA4B;AACrD,SAAO,aAAgB,eAAe,EAAK,YAAY;;;oBA5KN,iBAKC,MAWnD,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,WAAA,KAAA,EAAA,KAQzC,EAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,WAAA,KAAA,EAAA,KAWzC,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,WAAW;CAAiB,CAAC,CAAA,EAAA,EAAA,WAAA,eAAA,KAAA,EAAA,KAiBtE,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,cAAA,KAAA,EAAA"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ export declare const CARD_VALID_SIZES: readonly ["xs", "s", "m", "l", "xl"];
13
+ export declare const CARD_VARIANTS: readonly ["primary", "secondary", "tertiary", "quiet"];
14
+ export declare const CARD_DENSITIES: readonly ["compact", "regular", "spacious"];
15
+ export type CardSize = (typeof CARD_VALID_SIZES)[number];
16
+ export type CardVariant = (typeof CARD_VARIANTS)[number];
17
+ export type CardDensity = (typeof CARD_DENSITIES)[number];
@@ -0,0 +1,21 @@
1
+ //#region components/card/Card.types.ts
2
+ var e = [
3
+ "xs",
4
+ "s",
5
+ "m",
6
+ "l",
7
+ "xl"
8
+ ], t = [
9
+ "primary",
10
+ "secondary",
11
+ "tertiary",
12
+ "quiet"
13
+ ], n = [
14
+ "compact",
15
+ "regular",
16
+ "spacious"
17
+ ];
18
+ //#endregion
19
+ export { n as CARD_DENSITIES, e as CARD_VALID_SIZES, t as CARD_VARIANTS };
20
+
21
+ //# sourceMappingURL=Card.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Card.types.js","names":[],"sources":["../../../components/card/Card.types.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type { ElementSize } from '@adobe/spectrum-wc-core/mixins/index.js';\n\n// ──────────────────\n// SHARED\n// ──────────────────\n\nexport const CARD_VALID_SIZES = [\n 'xs',\n 's',\n 'm',\n 'l',\n 'xl',\n] as const satisfies readonly ElementSize[];\n\nexport const CARD_VARIANTS = [\n 'primary',\n 'secondary',\n 'tertiary',\n 'quiet',\n] as const;\n\nexport const CARD_DENSITIES = ['compact', 'regular', 'spacious'] as const;\n\n// ──────────────────\n// TYPES\n// ──────────────────\n\nexport type CardSize = (typeof CARD_VALID_SIZES)[number];\nexport type CardVariant = (typeof CARD_VARIANTS)[number];\nexport type CardDensity = (typeof CARD_DENSITIES)[number];\n"],"mappings":";AAkBA,IAAa,IAAmB;CAC9B;CACA;CACA;CACA;CACA;CACD,EAEY,IAAgB;CAC3B;CACA;CACA;CACA;CACD,EAEY,IAAiB;CAAC;CAAW;CAAW;CAAW"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ export * from './Card.base.js';
13
+ export * from './Card.types.js';
@@ -0,0 +1,3 @@
1
+ import { CARD_DENSITIES as e, CARD_VALID_SIZES as t, CARD_VARIANTS as n } from "./Card.types.js";
2
+ import { CardBase as r } from "./Card.base.js";
3
+ export { e as CARD_DENSITIES, t as CARD_VALID_SIZES, n as CARD_VARIANTS, r as CardBase };
@@ -0,0 +1,51 @@
1
+ import { PropertyValues } from 'lit';
2
+ import { SpectrumElement } from '../../element/index.js';
3
+ import { ColorHandleProperties } from './ColorHandle.types.js';
4
+ /**
5
+ * A non-interactive primitive: a draggable dot rendered on top of a color
6
+ * area, slider, or wheel that shows the currently picked color (over an
7
+ * opacity checkerboard) and pops a loupe on touch.
8
+ *
9
+ * The handle owns no ARIA role/name and is not independently focusable;
10
+ * accessibility is provided by the parent color picker. Its only net-new a11y
11
+ * obligation is WCAG 1.4.11 non-text contrast via an adaptive border, applied
12
+ * in the rendering layer.
13
+ *
14
+ * @element swc-color-handle
15
+ */
16
+ export declare abstract class ColorHandleBase extends SpectrumElement implements ColorHandleProperties {
17
+ /**
18
+ * The CSS color value shown inside the handle. Supports any valid CSS color
19
+ * string, including alpha transparency (which reveals the checkerboard).
20
+ *
21
+ * Default is semi-transparent red so the opacity checkerboard is visible
22
+ * when the component is rendered without a `color` attribute.
23
+ */
24
+ color: string;
25
+ /** Reflected. Suppresses the loupe (`open && !disabled`). */
26
+ disabled: boolean;
27
+ /**
28
+ * Reflected. Set by the parent color component when the parent picker is
29
+ * focused (keyboard or programmatic); enlarges the handle as the focus
30
+ * indicator.
31
+ */
32
+ focused: boolean;
33
+ /** Reflected. Shows the built-in loupe; auto-toggled by touch pointers. */
34
+ open: boolean;
35
+ /**
36
+ * Reflected. `true` shows the inner color swatch (1st-gen behavior);
37
+ * `false` renders an outline-only handle.
38
+ */
39
+ fill: boolean;
40
+ /**
41
+ * The adaptive dark-border opacity for the current `color`, derived by the
42
+ * white-first strategy so the handle chrome meets WCAG 1.4.11 (≥3:1) across
43
+ * the color spectrum. The rendering layer applies this to the dark borders.
44
+ *
45
+ * @internal
46
+ */
47
+ protected get borderAlpha(): number;
48
+ private handlePointerdown;
49
+ private handlePointerup;
50
+ protected firstUpdated(changed: PropertyValues): void;
51
+ }
@@ -0,0 +1,39 @@
1
+ import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
2
+ import { computeBorderAlpha as t } from "./color-contrast.js";
3
+ import { property as n } from "lit/decorators.js";
4
+ import { SpectrumElement as r } from "@adobe/spectrum-wc-core/element/index.js";
5
+ //#region components/color-handle/ColorHandle.base.ts
6
+ var i = class extends r {
7
+ constructor(...e) {
8
+ super(...e), this.color = "rgba(255, 0, 0, 0.5)", this.disabled = !1, this.focused = !1, this.open = !1, this.fill = !0;
9
+ }
10
+ get borderAlpha() {
11
+ return t(this.color);
12
+ }
13
+ handlePointerdown(e) {
14
+ e.pointerType === "touch" && (this.open = !0, this.setPointerCapture(e.pointerId));
15
+ }
16
+ handlePointerup(e) {
17
+ e.pointerType === "touch" && (this.open = !1, this.releasePointerCapture(e.pointerId));
18
+ }
19
+ firstUpdated(e) {
20
+ super.firstUpdated(e), this.addEventListener("pointerdown", this.handlePointerdown), this.addEventListener("pointerup", this.handlePointerup), this.addEventListener("pointercancel", this.handlePointerup);
21
+ }
22
+ };
23
+ e([n({ type: String })], i.prototype, "color", void 0), e([n({
24
+ type: Boolean,
25
+ reflect: !0
26
+ })], i.prototype, "disabled", void 0), e([n({
27
+ type: Boolean,
28
+ reflect: !0
29
+ })], i.prototype, "focused", void 0), e([n({
30
+ type: Boolean,
31
+ reflect: !0
32
+ })], i.prototype, "open", void 0), e([n({
33
+ type: Boolean,
34
+ reflect: !0
35
+ })], i.prototype, "fill", void 0);
36
+ //#endregion
37
+ export { i as ColorHandleBase };
38
+
39
+ //# sourceMappingURL=ColorHandle.base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorHandle.base.js","names":[],"sources":["../../../components/color-handle/ColorHandle.base.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { PropertyValues } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\n\nimport { computeBorderAlpha } from './color-contrast.js';\nimport { ColorHandleProperties } from './ColorHandle.types.js';\n\n/**\n * A non-interactive primitive: a draggable dot rendered on top of a color\n * area, slider, or wheel that shows the currently picked color (over an\n * opacity checkerboard) and pops a loupe on touch.\n *\n * The handle owns no ARIA role/name and is not independently focusable;\n * accessibility is provided by the parent color picker. Its only net-new a11y\n * obligation is WCAG 1.4.11 non-text contrast via an adaptive border, applied\n * in the rendering layer.\n *\n * @element swc-color-handle\n */\nexport abstract class ColorHandleBase\n extends SpectrumElement\n implements ColorHandleProperties\n{\n // ─────────────────\n // SHARED API\n // ─────────────────\n\n /**\n * The CSS color value shown inside the handle. Supports any valid CSS color\n * string, including alpha transparency (which reveals the checkerboard).\n *\n * Default is semi-transparent red so the opacity checkerboard is visible\n * when the component is rendered without a `color` attribute.\n */\n @property({ type: String })\n public color = 'rgba(255, 0, 0, 0.5)';\n\n /** Reflected. Suppresses the loupe (`open && !disabled`). */\n @property({ type: Boolean, reflect: true })\n public disabled = false;\n\n /**\n * Reflected. Set by the parent color component when the parent picker is\n * focused (keyboard or programmatic); enlarges the handle as the focus\n * indicator.\n */\n @property({ type: Boolean, reflect: true })\n public focused = false;\n\n /** Reflected. Shows the built-in loupe; auto-toggled by touch pointers. */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * Reflected. `true` shows the inner color swatch (1st-gen behavior);\n * `false` renders an outline-only handle.\n */\n @property({ type: Boolean, reflect: true })\n public fill = true;\n\n // ──────────────────────────\n // ADAPTIVE CONTRAST\n // ──────────────────────────\n\n /**\n * The adaptive dark-border opacity for the current `color`, derived by the\n * white-first strategy so the handle chrome meets WCAG 1.4.11 (≥3:1) across\n * the color spectrum. The rendering layer applies this to the dark borders.\n *\n * @internal\n */\n protected get borderAlpha(): number {\n return computeBorderAlpha(this.color);\n }\n\n // ──────────────────────────\n // POINTER / TOUCH BEHAVIOR\n // ──────────────────────────\n\n // Only touch opens the loupe, so only touch reserves the pointer. Mouse and\n // stylus are left alone rather than capturing pointers nothing consumes.\n private handlePointerdown(event: PointerEvent): void {\n if (event.pointerType !== 'touch') {\n return;\n }\n this.open = true;\n this.setPointerCapture(event.pointerId);\n }\n\n private handlePointerup(event: PointerEvent): void {\n if (event.pointerType !== 'touch') {\n return;\n }\n this.open = false;\n this.releasePointerCapture(event.pointerId);\n }\n\n protected override firstUpdated(changed: PropertyValues): void {\n super.firstUpdated(changed);\n this.addEventListener('pointerdown', this.handlePointerdown);\n this.addEventListener('pointerup', this.handlePointerup);\n this.addEventListener('pointercancel', this.handlePointerup);\n }\n}\n"],"mappings":";;;;;AAgCA,IAAsB,IAAtB,cACU,EAEV;;4BAaiB,wCAIG,mBAQD,gBAIH,gBAOA;;CAad,IAAc,cAAsB;AAClC,SAAO,EAAmB,KAAK,MAAM;;CASvC,kBAA0B,GAA2B;AAC/C,IAAM,gBAAgB,YAG1B,KAAK,OAAO,IACZ,KAAK,kBAAkB,EAAM,UAAU;;CAGzC,gBAAwB,GAA2B;AAC7C,IAAM,gBAAgB,YAG1B,KAAK,OAAO,IACZ,KAAK,sBAAsB,EAAM,UAAU;;CAG7C,aAAgC,GAA+B;AAI7D,EAHA,MAAM,aAAa,EAAQ,EAC3B,KAAK,iBAAiB,eAAe,KAAK,kBAAkB,EAC5D,KAAK,iBAAiB,aAAa,KAAK,gBAAgB,EACxD,KAAK,iBAAiB,iBAAiB,KAAK,gBAAgB;;;GAnE7D,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,SAAA,KAAA,EAAA,KAI1B,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,YAAA,KAAA,EAAA,KAQ1C,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,WAAA,KAAA,EAAA,KAI1C,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA,KAO1C,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ /**
13
+ * The public property contract for `swc-color-handle`.
14
+ *
15
+ * Color Handle exposes no variant, size, or treatment enums; its surface is a
16
+ * single string color plus four boolean flags. This interface documents that
17
+ * contract; the concrete decorated properties live on `ColorHandleBase`.
18
+ */
19
+ export interface ColorHandleProperties {
20
+ /** CSS color shown inside the handle; alpha reveals the opacity checkerboard. */
21
+ color: string;
22
+ /** Suppresses the loupe even when `open`. */
23
+ disabled: boolean;
24
+ /** Parent-set focus flag; enlarges the handle as the focus indicator. */
25
+ focused: boolean;
26
+ /** Shows the built-in loupe; auto-toggled by touch. */
27
+ open: boolean;
28
+ /** `true` shows the inner color swatch; `false` renders an outline-only handle. */
29
+ fill: boolean;
30
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ /**
13
+ * Adaptive white-first dual-border contrast helper (SWC-2295, RSP-2021,
14
+ * SDS-16402).
15
+ *
16
+ * The color handle renders a dark border, a white separator, and a second dark
17
+ * border. To meet WCAG 1.4.11 non-text contrast (≥3:1) across the color
18
+ * spectrum, the opacity (α) of the dark borders is computed adaptively:
19
+ *
20
+ * - If the white separator already meets 3:1 against the underlying color, the
21
+ * dark borders stay at the floor opacity for softer, uniform chrome
22
+ * (white-first).
23
+ * - Otherwise α climbs from the floor until the dark border itself meets 3:1.
24
+ *
25
+ * **v1 limitation (A1):** the underlying color is approximated by the handle's
26
+ * own `color`, not by sampling the surrounding gradient. This is accurate on
27
+ * smooth gradients and approximate at steep or saturated edges.
28
+ */
29
+ /** Minimum dark-border opacity (matches the 1st-gen static 42%). */
30
+ export declare const COLOR_HANDLE_ALPHA_FLOOR = 0.42;
31
+ /** WCAG 1.4.11 non-text contrast target. */
32
+ export declare const COLOR_HANDLE_CONTRAST_TARGET = 3;
33
+ type Rgb = [number, number, number];
34
+ /** Standard WCAG 2.2 contrast ratio between two opaque sRGB colors. */
35
+ export declare function contrastRatio(colorA: Rgb, colorB: Rgb): number;
36
+ /**
37
+ * Predicts the rendered color of a black border painted at opacity α over an
38
+ * opaque background.
39
+ */
40
+ export declare function compositeBlackOver([r, g, b]: Rgb, alpha: number): Rgb;
41
+ /**
42
+ * The minimum α in `[floor, 1]` that makes a black border composited over
43
+ * `adjacency` meet `target` contrast against that same adjacency.
44
+ */
45
+ export declare function findMinAlpha(adjacency: Rgb, target?: number, floor?: number): number;
46
+ /**
47
+ * Computes the adaptive dark-border opacity for a handle showing `color`,
48
+ * using the white-first strategy. Returns the floor when `color` cannot be
49
+ * parsed so the border is never weaker than 1st-gen.
50
+ */
51
+ export declare function computeBorderAlpha(color: string, { target, floor, }?: {
52
+ target?: number;
53
+ floor?: number;
54
+ }): number;
55
+ export {};
@@ -0,0 +1,49 @@
1
+ import e from "colorjs.io";
2
+ //#region components/color-handle/color-contrast.ts
3
+ var t = .42, n = 3, r = [
4
+ 255,
5
+ 255,
6
+ 255
7
+ ];
8
+ function i(e) {
9
+ let t = e / 255;
10
+ return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
11
+ }
12
+ function a([e, t, n]) {
13
+ return .2126 * i(e) + .7152 * i(t) + .0722 * i(n);
14
+ }
15
+ function o(e, t) {
16
+ let n = a(e), r = a(t), i = Math.max(n, r), o = Math.min(n, r);
17
+ return (i + .05) / (o + .05);
18
+ }
19
+ function s([e, t, n], r) {
20
+ return [
21
+ Math.round(e * (1 - r)),
22
+ Math.round(t * (1 - r)),
23
+ Math.round(n * (1 - r))
24
+ ];
25
+ }
26
+ function c(e, n = 3, r = t) {
27
+ for (let t = r; t <= 1.000000001; t += .01) if (o(s(e, t), e) >= n) return Math.min(1, Math.round(t * 100) / 100);
28
+ return 1;
29
+ }
30
+ function l(t) {
31
+ try {
32
+ let [n, r, i] = new e(t).to("srgb").coords, a = (e) => Math.max(0, Math.min(255, Math.round(e * 255)));
33
+ return [
34
+ a(n),
35
+ a(r),
36
+ a(i)
37
+ ];
38
+ } catch (e) {
39
+ return null;
40
+ }
41
+ }
42
+ function u(e, { target: n = 3, floor: i = t } = {}) {
43
+ let a = l(e);
44
+ return !a || o(r, a) >= n ? i : c(a, n, i);
45
+ }
46
+ //#endregion
47
+ export { t as COLOR_HANDLE_ALPHA_FLOOR, n as COLOR_HANDLE_CONTRAST_TARGET, s as compositeBlackOver, u as computeBorderAlpha, o as contrastRatio, c as findMinAlpha };
48
+
49
+ //# sourceMappingURL=color-contrast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-contrast.js","names":[],"sources":["../../../components/color-handle/color-contrast.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport Color from 'colorjs.io';\n\n/**\n * Adaptive white-first dual-border contrast helper (SWC-2295, RSP-2021,\n * SDS-16402).\n *\n * The color handle renders a dark border, a white separator, and a second dark\n * border. To meet WCAG 1.4.11 non-text contrast (≥3:1) across the color\n * spectrum, the opacity (α) of the dark borders is computed adaptively:\n *\n * - If the white separator already meets 3:1 against the underlying color, the\n * dark borders stay at the floor opacity for softer, uniform chrome\n * (white-first).\n * - Otherwise α climbs from the floor until the dark border itself meets 3:1.\n *\n * **v1 limitation (A1):** the underlying color is approximated by the handle's\n * own `color`, not by sampling the surrounding gradient. This is accurate on\n * smooth gradients and approximate at steep or saturated edges.\n */\n\n/** Minimum dark-border opacity (matches the 1st-gen static 42%). */\nexport const COLOR_HANDLE_ALPHA_FLOOR = 0.42;\n\n/** WCAG 1.4.11 non-text contrast target. */\nexport const COLOR_HANDLE_CONTRAST_TARGET = 3;\n\ntype Rgb = [number, number, number];\n\nconst WHITE: Rgb = [255, 255, 255];\n\nfunction srgbToLinear(channel: number): number {\n const c = channel / 255;\n return c <= 0.04045 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);\n}\n\nfunction relativeLuminance([r, g, b]: Rgb): number {\n return (\n 0.2126 * srgbToLinear(r) +\n 0.7152 * srgbToLinear(g) +\n 0.0722 * srgbToLinear(b)\n );\n}\n\n/** Standard WCAG 2.2 contrast ratio between two opaque sRGB colors. */\nexport function contrastRatio(colorA: Rgb, colorB: Rgb): number {\n const la = relativeLuminance(colorA);\n const lb = relativeLuminance(colorB);\n const hi = Math.max(la, lb);\n const lo = Math.min(la, lb);\n return (hi + 0.05) / (lo + 0.05);\n}\n\n/**\n * Predicts the rendered color of a black border painted at opacity α over an\n * opaque background.\n */\nexport function compositeBlackOver([r, g, b]: Rgb, alpha: number): Rgb {\n return [\n Math.round(r * (1 - alpha)),\n Math.round(g * (1 - alpha)),\n Math.round(b * (1 - alpha)),\n ];\n}\n\n/**\n * The minimum α in `[floor, 1]` that makes a black border composited over\n * `adjacency` meet `target` contrast against that same adjacency.\n */\nexport function findMinAlpha(\n adjacency: Rgb,\n target: number = COLOR_HANDLE_CONTRAST_TARGET,\n floor: number = COLOR_HANDLE_ALPHA_FLOOR\n): number {\n for (let a = floor; a <= 1 + 1e-9; a += 0.01) {\n if (contrastRatio(compositeBlackOver(adjacency, a), adjacency) >= target) {\n return Math.min(1, Math.round(a * 100) / 100);\n }\n }\n return 1;\n}\n\n/**\n * Parses a CSS color string to opaque sRGB channels in `[0, 255]`. Alpha is\n * intentionally dropped: the border sits over the composited swatch, whose hue\n * is what matters for the contrast decision. Returns `null` for unparseable\n * input so callers can fall back to the floor.\n */\nfunction parseToRgb255(color: string): Rgb | null {\n try {\n const [r, g, b] = new Color(color).to('srgb').coords;\n const clamp = (c: number): number =>\n Math.max(0, Math.min(255, Math.round(c * 255)));\n return [clamp(r), clamp(g), clamp(b)];\n } catch {\n return null;\n }\n}\n\n/**\n * Computes the adaptive dark-border opacity for a handle showing `color`,\n * using the white-first strategy. Returns the floor when `color` cannot be\n * parsed so the border is never weaker than 1st-gen.\n */\nexport function computeBorderAlpha(\n color: string,\n {\n target = COLOR_HANDLE_CONTRAST_TARGET,\n floor = COLOR_HANDLE_ALPHA_FLOOR,\n }: { target?: number; floor?: number } = {}\n): number {\n const adjacency = parseToRgb255(color);\n if (!adjacency) {\n return floor;\n }\n // White-first: if the white separator already carries 3:1, keep the softer\n // floor; otherwise escalate α until the dark border itself passes.\n if (contrastRatio(WHITE, adjacency) >= target) {\n return floor;\n }\n return findMinAlpha(adjacency, target, floor);\n}\n"],"mappings":";;AAiCA,IAAa,IAA2B,KAG3B,IAA+B,GAItC,IAAa;CAAC;CAAK;CAAK;CAAI;AAElC,SAAS,EAAa,GAAyB;CAC7C,IAAM,IAAI,IAAU;AACpB,QAAO,KAAK,SAAU,IAAI,UAAkB,IAAI,QAAS,UAAO;;AAGlE,SAAS,EAAkB,CAAC,GAAG,GAAG,IAAiB;AACjD,QACE,QAAS,EAAa,EAAE,GACxB,QAAS,EAAa,EAAE,GACxB,QAAS,EAAa,EAAE;;AAK5B,SAAgB,EAAc,GAAa,GAAqB;CAC9D,IAAM,IAAK,EAAkB,EAAO,EAC9B,IAAK,EAAkB,EAAO,EAC9B,IAAK,KAAK,IAAI,GAAI,EAAG,EACrB,IAAK,KAAK,IAAI,GAAI,EAAG;AAC3B,SAAQ,IAAK,QAAS,IAAK;;AAO7B,SAAgB,EAAmB,CAAC,GAAG,GAAG,IAAS,GAAoB;AACrE,QAAO;EACL,KAAK,MAAM,KAAK,IAAI,GAAO;EAC3B,KAAK,MAAM,KAAK,IAAI,GAAO;EAC3B,KAAK,MAAM,KAAK,IAAI,GAAO;EAC5B;;AAOH,SAAgB,EACd,GACA,IAAA,GACA,IAAgB,GACR;AACR,MAAK,IAAI,IAAI,GAAO,KAAK,aAAU,KAAK,IACtC,KAAI,EAAc,EAAmB,GAAW,EAAE,EAAE,EAAU,IAAI,EAChE,QAAO,KAAK,IAAI,GAAG,KAAK,MAAM,IAAI,IAAI,GAAG,IAAI;AAGjD,QAAO;;AAST,SAAS,EAAc,GAA2B;AAChD,KAAI;EACF,IAAM,CAAC,GAAG,GAAG,KAAK,IAAI,EAAM,EAAM,CAAC,GAAG,OAAO,CAAC,QACxC,KAAS,MACb,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,KAAK,MAAM,IAAI,IAAI,CAAC,CAAC;AACjD,SAAO;GAAC,EAAM,EAAE;GAAE,EAAM,EAAE;GAAE,EAAM,EAAE;GAAC;aAC/B;AACN,SAAO;;;AASX,SAAgB,EACd,GACA,EACE,YAAA,GACA,WAAQ,MAC+B,EAAE,EACnC;CACR,IAAM,IAAY,EAAc,EAAM;AAStC,QARI,CAAC,KAKD,EAAc,GAAO,EAAU,IAAI,IAC9B,IAEF,EAAa,GAAW,GAAQ,EAAM"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ export * from './ColorHandle.base.js';
13
+ export * from './ColorHandle.types.js';
14
+ export * from './color-contrast.js';
@@ -0,0 +1,3 @@
1
+ import { COLOR_HANDLE_ALPHA_FLOOR as e, COLOR_HANDLE_CONTRAST_TARGET as t, compositeBlackOver as n, computeBorderAlpha as r, contrastRatio as i, findMinAlpha as a } from "./color-contrast.js";
2
+ import { ColorHandleBase as o } from "./ColorHandle.base.js";
3
+ export { e as COLOR_HANDLE_ALPHA_FLOOR, t as COLOR_HANDLE_CONTRAST_TARGET, o as ColorHandleBase, n as compositeBlackOver, r as computeBorderAlpha, i as contrastRatio, a as findMinAlpha };
@@ -0,0 +1,26 @@
1
+ import { SpectrumElement } from '../../element/index.js';
2
+ /**
3
+ * A visual magnifier that shows the currently picked color, including
4
+ * transparency over an opacity checkerboard, inside a loupe shape.
5
+ *
6
+ * The loupe is not an interactive control — accessibility semantics are
7
+ * provided by the parent color picker / color field.
8
+ *
9
+ * @element swc-color-loupe
10
+ */
11
+ export declare abstract class ColorLoupeBase extends SpectrumElement {
12
+ /**
13
+ * Whether the loupe is visible. When `false` the loupe is hidden via
14
+ * CSS opacity and transform transitions.
15
+ */
16
+ open: boolean;
17
+ /**
18
+ * The CSS color value to display inside the loupe.
19
+ * Supports any valid CSS color string, including those with alpha
20
+ * transparency (which reveals the checkerboard behind).
21
+ *
22
+ * Default is semi-transparent red so the opacity checkerboard is visible
23
+ * when the component is rendered without a `color` attribute.
24
+ */
25
+ color: string;
26
+ }
@@ -0,0 +1,17 @@
1
+ import { __decorate as e } from "../../_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js";
2
+ import { property as t } from "lit/decorators.js";
3
+ import { SpectrumElement as n } from "@adobe/spectrum-wc-core/element/index.js";
4
+ //#region components/color-loupe/ColorLoupe.base.ts
5
+ var r = class extends n {
6
+ constructor(...e) {
7
+ super(...e), this.open = !1, this.color = "rgba(255, 0, 0, 0.5)";
8
+ }
9
+ };
10
+ e([t({
11
+ type: Boolean,
12
+ reflect: !0
13
+ })], r.prototype, "open", void 0), e([t({ type: String })], r.prototype, "color", void 0);
14
+ //#endregion
15
+ export { r as ColorLoupeBase };
16
+
17
+ //# sourceMappingURL=ColorLoupe.base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorLoupe.base.js","names":[],"sources":["../../../components/color-loupe/ColorLoupe.base.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { property } from 'lit/decorators.js';\n\nimport { SpectrumElement } from '@adobe/spectrum-wc-core/element/index.js';\n\n/**\n * A visual magnifier that shows the currently picked color, including\n * transparency over an opacity checkerboard, inside a loupe shape.\n *\n * The loupe is not an interactive control — accessibility semantics are\n * provided by the parent color picker / color field.\n *\n * @element swc-color-loupe\n */\nexport abstract class ColorLoupeBase extends SpectrumElement {\n // ─────────────────\n // SHARED API\n // ─────────────────\n\n /**\n * Whether the loupe is visible. When `false` the loupe is hidden via\n * CSS opacity and transform transitions.\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n /**\n * The CSS color value to display inside the loupe.\n * Supports any valid CSS color string, including those with alpha\n * transparency (which reveals the checkerboard behind).\n *\n * Default is semi-transparent red so the opacity checkerboard is visible\n * when the component is rendered without a `color` attribute.\n */\n @property({ type: String })\n public color = 'rgba(255, 0, 0, 0.5)';\n}\n"],"mappings":";;;;AAyBA,IAAsB,IAAtB,cAA6C,EAAgB;;2BAU7C,iBAWC;;;GAZd,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC,CAAA,EAAA,EAAA,WAAA,QAAA,KAAA,EAAA,KAW1C,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,EAAA,EAAA,WAAA,SAAA,KAAA,EAAA"}