@orangelogic/design-system 2.60.0 → 2.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/library/apps/cortex/src/types.d.ts +2 -0
  2. package/library/chunks/_baseRest.ClTMQtN1.js +67 -0
  3. package/library/chunks/{_baseUniq.BUihBa8c.js → _baseUniq.Df-fLIBx.js} +53 -56
  4. package/library/chunks/{amazon_s3.DeaMdPPn.js → amazon_s3.BEMtqafk.js} +1 -1
  5. package/library/chunks/animate.El-MpOws.js +37 -0
  6. package/library/chunks/animation-registry.HmpwNuGH.js +34 -0
  7. package/library/chunks/{animation.B7d72NVK.js → animation.DfUHRQry.js} +10 -8
  8. package/library/chunks/array.DCtvHiLS.js +81 -0
  9. package/library/chunks/asset.CG_yXtWK.js +288 -0
  10. package/library/chunks/{browser.Va59Ix3P.js → browser.BHOCIF_A.js} +18 -16
  11. package/library/chunks/{button.CtCSNRB3.js → button.P71VJ5xh.js} +75 -74
  12. package/library/chunks/{button.styles.C8AIO8fd.js → button.styles.Dl5IQLHU.js} +1 -1
  13. package/library/chunks/{capitalize.CNStXZBq.js → capitalize.WSkCXkNE.js} +1 -1
  14. package/library/chunks/{chatbot.sm4Rph1v.js → chatbot.BmpIu59L.js} +2 -2
  15. package/library/chunks/{class-map.CoZTSvbM.js → class-map.BiVq-cVR.js} +1 -1
  16. package/library/chunks/{color-swatch-group.qJevXs50.js → color-swatch-group.DlLmydlB.js} +116 -127
  17. package/library/chunks/color-swatch.Bpb_hW2H.js +407 -0
  18. package/library/chunks/color.vLD2sNTs.js +164 -0
  19. package/library/chunks/{component.styles.CI-v8BZa.js → component.styles.DMSLciL5.js} +1 -1
  20. package/library/chunks/{confirm-popover.D2TF1x6K.js → confirm-popover.C1uA36JR.js} +15 -13
  21. package/library/chunks/{content-builder.WranV3P4.js → content-builder.Bf7kqzDI.js} +1 -1
  22. package/library/chunks/converters.DkDtLstb.js +11 -0
  23. package/library/chunks/{cropper.aA0v16xS.js → cropper.BraEEykE.js} +5004 -5024
  24. package/library/chunks/custom-element.L4WJXn1j.js +14 -0
  25. package/library/chunks/debounce.DaHuiSGU.js +15 -0
  26. package/library/chunks/{default-value.CIKAvD5l.js → default-value.COZopaet.js} +1 -1
  27. package/library/chunks/{dialog.B1TORO6S.js → dialog.C_75RVVz.js} +52 -49
  28. package/library/chunks/{directive-helpers.DBHob-_L.js → directive-helpers.Dm4rc594.js} +1 -1
  29. package/library/chunks/dom.CZrJ64Dm.js +92 -0
  30. package/library/chunks/{dot-pagination.8f2oX_ge.js → dot-pagination.CoCIJsHC.js} +24 -22
  31. package/library/chunks/{endpoints.BgyupJys.js → endpoints.B7lcoc1N.js} +1 -3
  32. package/library/chunks/{file-on-demand.Cwgabdyw.js → file-on-demand.B2jNilAj.js} +1829 -1544
  33. package/library/chunks/{folder-select.DiWCwR-T.js → folder-select.CSEQxIXF.js} +380 -255
  34. package/library/chunks/{form-control.styles.NE2Q-quE.js → form-control.styles.CUGhvlfT.js} +1 -1
  35. package/library/chunks/{form.B8u0ywni.js → form.CO12-VK0.js} +1 -1
  36. package/library/chunks/{guard.BDP4A85K.js → guard.D4axKaMo.js} +1 -1
  37. package/library/chunks/{header.B_FD8uLt.js → header.Bd3G0-oA.js} +11 -9
  38. package/library/chunks/{hub-connection.CxfaT11o.js → hub-connection.BxT2b7Nq.js} +4 -3
  39. package/library/chunks/{i18n.BP2FRO1v.js → i18n.DrzK7TPf.js} +54 -7
  40. package/library/chunks/identity.ByMq8VxU.js +6 -0
  41. package/library/chunks/{if-defined.MfEgpxEN.js → if-defined.BRoBj_Rp.js} +1 -1
  42. package/library/chunks/{iframe.DZm7FiCl.js → iframe.UCj6Ze2A.js} +18 -16
  43. package/library/chunks/{image.Ycf8RudS.js → image.DZCRhE3G.js} +82 -79
  44. package/library/chunks/image.mbpyiQpQ.js +82 -0
  45. package/library/chunks/index.S0wy3rzm.js +373 -0
  46. package/library/chunks/isObjectLike.D3cpZO39.js +81 -0
  47. package/library/chunks/{isSymbol.L0C2ND_U.js → isSymbol.huJ_Cvxt.js} +1 -1
  48. package/library/chunks/lib-cortex-element.CVMmyPMC.js +146 -0
  49. package/library/chunks/{list-editor.COkw5JKG.js → list-editor.CrLntuM7.js} +75 -79
  50. package/library/chunks/{custom-element.vnXBMQxc.js → lit-element.jLBm65_O.js} +123 -277
  51. package/library/chunks/{live.LdB9xEhp.js → live.SCz6M8Gs.js} +2 -2
  52. package/library/chunks/{mailchimp.BjbPJfd-.js → mailchimp.Bs6uJVsf.js} +1 -1
  53. package/library/chunks/{modal.BqNLxgs1.js → modal.U1QltQKe.js} +25 -19
  54. package/library/chunks/{option.D9KJhzHs.js → option.D1u5-cTt.js} +21 -19
  55. package/library/chunks/{orangelogic.BgbQXkBv.js → orangelogic.TdFfoPUN.js} +1 -1
  56. package/library/chunks/{overlayscrollbars.aFuRG5Rs.js → overlayscrollbars.XhGWx9Zk.js} +1 -1
  57. package/library/chunks/{pagination.C2FN4fmO.js → pagination.BI3LONVU.js} +17 -15
  58. package/library/chunks/{ref.BaCjlzLO.js → ref.bzeTdX0K.js} +2 -2
  59. package/library/chunks/{repeat.CauKaXyy.js → repeat.DbF2p5ae.js} +2 -2
  60. package/library/chunks/responsive.CA6dcNiM.js +17 -0
  61. package/library/chunks/{scroll.DwPiX2Ox.js → scroll.xtO5yojm.js} +3 -2
  62. package/library/chunks/{slot.DJLm4Dig.js → slot.j5oheLJC.js} +12 -4
  63. package/library/chunks/{state.Cw55xXlb.js → state.CSDxrqLd.js} +1 -1
  64. package/library/chunks/{static.BjNkqt7_.js → static.UA3G1Deq.js} +1 -1
  65. package/library/chunks/string.Cp_XNbnV.js +160 -0
  66. package/library/chunks/{style-map.CZovMmo_.js → style-map.llVFPd__.js} +1 -1
  67. package/library/chunks/{tab-group.5fLnWflv.js → tab-group.DxSlcWK0.js} +20 -18
  68. package/library/chunks/{table.BAr8KKc6.js → table.CY-iMTWV.js} +457 -505
  69. package/library/chunks/template.CsJd8Pb_.js +20 -0
  70. package/library/chunks/time.D_uFZqqe.js +118 -0
  71. package/library/chunks/{toString.CL_lYXbK.js → toString.CRT5zqEU.js} +3 -3
  72. package/library/chunks/toast.BXNbwZV8.js +25 -0
  73. package/library/chunks/{tree.CUfvIDyA.js → tree.CNbrP8cY.js} +33 -36
  74. package/library/chunks/{typography.BFpl0WMA.js → typography.oDzoLbZS.js} +16 -14
  75. package/library/chunks/{unsafe-html.DyO9_Rsq.js → unsafe-html.Dff7-rCx.js} +1 -1
  76. package/library/chunks/url.LjsR2sB5.js +15 -0
  77. package/library/chunks/user-agent.D9aPuOyL.js +4 -0
  78. package/library/chunks/watch.q1sEjPWL.js +501 -0
  79. package/library/components/alert.js +38 -35
  80. package/library/components/animated-image.js +25 -23
  81. package/library/components/animation.js +7 -5
  82. package/library/components/array-line-clamp.d.ts +3 -0
  83. package/library/components/array-line-clamp.js +195 -0
  84. package/library/components/asset-link-format.js +223 -212
  85. package/library/components/atoms.js +164 -162
  86. package/library/components/avatar.js +28 -26
  87. package/library/components/badge.js +10 -8
  88. package/library/components/bicolor-picker.js +21 -19
  89. package/library/components/border-input-group.js +11 -9
  90. package/library/components/breadcrumb-item.js +14 -12
  91. package/library/components/breadcrumb.js +24 -22
  92. package/library/components/button-group.js +26 -24
  93. package/library/components/button.js +14 -13
  94. package/library/components/card.js +28 -19
  95. package/library/components/checkbox.js +29 -23
  96. package/library/components/color-picker.js +19 -17
  97. package/library/components/color-swatch-group.js +20 -17
  98. package/library/components/color-swatch.js +16 -13
  99. package/library/components/confirm-popover.js +11 -9
  100. package/library/components/copy-button.js +15 -13
  101. package/library/components/corner-position-input-group.js +13 -11
  102. package/library/components/cortex-element.d.ts +3 -0
  103. package/library/components/cortex-element.js +5 -0
  104. package/library/components/cropper.js +7 -5
  105. package/library/components/details.js +23 -20
  106. package/library/components/dialog.js +19 -16
  107. package/library/components/divider.js +13 -11
  108. package/library/components/dot-pagination.js +11 -9
  109. package/library/components/dot-status.js +10 -8
  110. package/library/components/drawer.js +63 -51
  111. package/library/components/dropdown.js +29 -26
  112. package/library/components/dynamic-select.js +12 -10
  113. package/library/components/element-clamp.js +28 -25
  114. package/library/components/file-on-demand.js +21 -20
  115. package/library/components/folder-select.js +12 -10
  116. package/library/components/format-bytes.js +11 -10
  117. package/library/components/format-date.js +11 -9
  118. package/library/components/format-number.js +16 -15
  119. package/library/components/format-time.js +118 -9
  120. package/library/components/grid-item.js +48 -46
  121. package/library/components/grid.js +31 -29
  122. package/library/components/header.js +10 -9
  123. package/library/components/hub-connection.js +6 -5
  124. package/library/components/icon-button.js +20 -18
  125. package/library/components/icon.js +17 -15
  126. package/library/components/iframe.js +10 -8
  127. package/library/components/image-comparer.js +27 -25
  128. package/library/components/image.js +14 -11
  129. package/library/components/include.js +26 -24
  130. package/library/components/input-group.js +15 -13
  131. package/library/components/input.js +23 -21
  132. package/library/components/line-clamp.js +12 -10
  133. package/library/components/list-editor.js +17 -15
  134. package/library/components/markdown.js +80 -78
  135. package/library/components/masonry.js +46 -44
  136. package/library/components/menu-item.js +151 -136
  137. package/library/components/menu-label.js +15 -13
  138. package/library/components/menu-section.js +18 -16
  139. package/library/components/menu.js +10 -8
  140. package/library/components/molecules.js +5 -5
  141. package/library/components/mutation-observer.js +12 -10
  142. package/library/components/option.js +10 -8
  143. package/library/components/organisms.js +2 -2
  144. package/library/components/padding-input-group.js +30 -28
  145. package/library/components/pagination.js +14 -12
  146. package/library/components/popup.js +3296 -9
  147. package/library/components/position-picker.js +12 -10
  148. package/library/components/progress-bar.js +13 -11
  149. package/library/components/progress-ring.js +15 -13
  150. package/library/components/qr-code.js +54 -52
  151. package/library/components/radio-button.js +19 -17
  152. package/library/components/radio-card.js +14 -12
  153. package/library/components/radio-group.js +20 -18
  154. package/library/components/radio.js +15 -13
  155. package/library/components/range.js +25 -23
  156. package/library/components/rating.js +17 -15
  157. package/library/components/relative-time.js +16 -14
  158. package/library/components/resize-observer.js +21 -19
  159. package/library/components/select.js +1442 -25
  160. package/library/components/shadow-input-group.js +19 -17
  161. package/library/components/share-option-list.js +20 -18
  162. package/library/components/sidebar.js +14 -12
  163. package/library/components/size-input-group.js +35 -33
  164. package/library/components/skeleton.js +12 -10
  165. package/library/components/space.js +12 -10
  166. package/library/components/spinner.js +17 -15
  167. package/library/components/split-panel.js +15 -13
  168. package/library/components/step.js +18 -16
  169. package/library/components/stepper-wizard.js +11 -9
  170. package/library/components/stepper.js +13 -11
  171. package/library/components/switch.js +21 -19
  172. package/library/components/tab-group.js +15 -13
  173. package/library/components/tab-panel.js +20 -18
  174. package/library/components/tab.js +18 -16
  175. package/library/components/table.js +69 -67
  176. package/library/components/tag.js +11 -9
  177. package/library/components/textarea.js +20 -18
  178. package/library/components/timecode.js +98 -8
  179. package/library/components/tooltip.js +24 -21
  180. package/library/components/tree-item.js +14 -11
  181. package/library/components/tree.js +12 -10
  182. package/library/components/typeface.js +13 -11
  183. package/library/components/types.js +15487 -15444
  184. package/library/components/typography.js +6 -4
  185. package/library/components/video.js +13 -11
  186. package/library/components/visually-hidden.js +15 -13
  187. package/library/events.d.ts +1 -0
  188. package/library/events.js +1 -0
  189. package/library/package.json +11 -2
  190. package/library/packages/atoms/src/components/array-line-clamp/array-line-clamp.d.ts +45 -0
  191. package/library/packages/atoms/src/components/array-line-clamp/array-line-clamp.styles.d.ts +2 -0
  192. package/library/packages/atoms/src/components/checkbox/checkbox.d.ts +2 -0
  193. package/library/packages/atoms/src/components/drawer/drawer.d.ts +7 -1
  194. package/library/packages/atoms/src/components/include/include.d.ts +1 -0
  195. package/library/packages/atoms/src/components/menu-item/menu-item.d.ts +2 -0
  196. package/library/packages/atoms/src/components/tree/tree.d.ts +0 -4
  197. package/library/packages/atoms/src/index.d.ts +1 -0
  198. package/library/packages/events/src/cx-file-on-demand-load-more.d.ts +8 -0
  199. package/library/packages/events/src/cx-file-on-demand-pin.d.ts +8 -0
  200. package/library/packages/events/src/cx-file-on-demand-unpin.d.ts +8 -0
  201. package/library/packages/events/src/cx-folder-select-search-term-change.d.ts +8 -0
  202. package/library/packages/events/src/cx-share-option-list-item-selected.d.ts +8 -0
  203. package/library/packages/events/src/events.d.ts +6 -2
  204. package/library/packages/molecules/src/asset-picker/asset-picker.d.ts +2 -0
  205. package/library/packages/molecules/src/cropper/cropper.d.ts +1 -0
  206. package/library/packages/molecules/src/cropper/react/Cropper.d.ts +1 -0
  207. package/library/packages/molecules/src/download-format-picker/download-format-picker.d.ts +1 -0
  208. package/library/packages/molecules/src/folder-select/components/folder-select-tree/folder-select-tree.d.ts +8 -0
  209. package/library/packages/molecules/src/folder-select/components/folder-select-tree-item/folder-select-tree-item.d.ts +1 -0
  210. package/library/packages/molecules/src/folder-select/folder-select.d.ts +6 -1
  211. package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +3 -7
  212. package/library/packages/organisms/src/content-builder/styleController.d.ts +8 -8
  213. package/library/packages/organisms/src/file-on-demand/components/file-on-demand-asset/file-on-demand-asset.d.ts +80 -0
  214. package/library/packages/organisms/src/file-on-demand/components/file-on-demand-asset/file-on-demand-asset.styles.d.ts +2 -0
  215. package/library/packages/organisms/src/file-on-demand/components/file-on-demand-pinned-status.ts/file-on-demand-pinned-status.d.ts +44 -0
  216. package/library/packages/organisms/src/file-on-demand/file-on-demand.constants.d.ts +1 -0
  217. package/library/packages/organisms/src/file-on-demand/file-on-demand.d.ts +11 -18
  218. package/library/packages/organisms/src/file-on-demand/file-on-demand.utils.d.ts +6 -0
  219. package/library/packages/services/src/api/folder/folder.d.ts +4 -8
  220. package/library/packages/services/src/api/folder/folder.types.d.ts +2 -1
  221. package/library/packages/types/src/file-on-demand.d.ts +4 -0
  222. package/library/packages/types/src/folder-select.d.ts +9 -2
  223. package/library/packages/utils/src/custom-element/i18n.d.ts +40 -2
  224. package/library/packages/utils/src/drag-scroll/drag-scroll.d.ts +22 -0
  225. package/library/packages/utils/src/drag-scroll/index.d.ts +1 -0
  226. package/library/packages/utils/src/font/font.d.ts +26 -0
  227. package/library/packages/utils/src/font/index.d.ts +1 -0
  228. package/library/packages/utils/src/history-manager/history-manager.d.ts +13 -0
  229. package/library/packages/utils/src/history-manager/index.d.ts +1 -0
  230. package/library/packages/utils/src/index.d.ts +45 -0
  231. package/library/packages/utils/src/template/index.d.ts +1 -0
  232. package/library/packages/utils/src/template/template.d.ts +3 -0
  233. package/library/react-web-component.d.ts +418 -360
  234. package/library/utils.d.ts +1 -0
  235. package/library/utils.js +180 -0
  236. package/package.json +11 -2
  237. package/library/chunks/animation-registry.DavRkTTr.js +0 -69
  238. package/library/chunks/asset.Ba-CxnNM.js +0 -309
  239. package/library/chunks/color-swatch.DUe3iLLo.js +0 -558
  240. package/library/chunks/dom.C0OFx7ND.js +0 -78
  241. package/library/chunks/format-time.BW6-ZWCX.js +0 -226
  242. package/library/chunks/isObjectLike.z36Fu426.js +0 -34
  243. package/library/chunks/popup._w5T7x8f.js +0 -3307
  244. package/library/chunks/select.DfO4de04.js +0 -1441
  245. package/library/chunks/string.BCk3SmdZ.js +0 -144
  246. package/library/chunks/timecode.D7XTiQ_3.js +0 -105
  247. package/library/chunks/watch.BCJD77bD.js +0 -547
  248. package/library/packages/events/src/cx-load-more.d.ts +0 -8
@@ -0,0 +1,407 @@
1
+ import v from "../components/copy-button.js";
2
+ import f from "../components/line-clamp.js";
3
+ import w from "../components/resize-observer.js";
4
+ import b from "../components/space.js";
5
+ import { C as _ } from "./typography.oDzoLbZS.js";
6
+ import { n as a, C as k } from "./lib-cortex-element.CVMmyPMC.js";
7
+ import { c as F } from "./component.styles.DMSLciL5.js";
8
+ import { c as n, C as h, H as $, l as z } from "./color.vLD2sNTs.js";
9
+ import { c as O } from "./custom-element.L4WJXn1j.js";
10
+ import { d as W } from "./debounce.DaHuiSGU.js";
11
+ import { L as A } from "./i18n.DrzK7TPf.js";
12
+ import { w as i } from "./watch.q1sEjPWL.js";
13
+ import { i as G, x as u } from "./lit-element.jLBm65_O.js";
14
+ import { r as c } from "./state.CSDxrqLd.js";
15
+ import { e as R } from "./query.BBf1UFkC.js";
16
+ import { e as g } from "./class-map.BiVq-cVR.js";
17
+ import { o as x } from "./if-defined.BRoBj_Rp.js";
18
+ import { c as U } from "./repeat.DbF2p5ae.js";
19
+ import { o as l } from "./style-map.llVFPd__.js";
20
+ import { n as E } from "./when.Dr1es41R.js";
21
+ var p = /* @__PURE__ */ ((o) => (o.Circle = "circle", o.GridItem = "grid-item", o.Oval = "oval", o))(p || {});
22
+ const S = G`
23
+ :host {
24
+ display: block;
25
+ }
26
+
27
+ .color-swatch {
28
+ border: 1px solid var(--cx-color-neutral-200);
29
+ display: flex;
30
+ justify-content: center;
31
+ align-items: center;
32
+ }
33
+
34
+ .color-swatch:focus-visible {
35
+ outline: var(--cx-focus-ring);
36
+ outline-offset: var(--cx-focus-ring-offset);
37
+ }
38
+
39
+ .color-swatch--circle {
40
+ aspect-ratio: 1 / 1;
41
+ height: auto;
42
+ width: var(--swatch-size, 350px);
43
+ min-width: var(--swatch-size, 230px);
44
+ max-width: 100%;
45
+ border-radius: var(--cx-border-radius-circle);
46
+ }
47
+
48
+ .color-swatch--oval {
49
+ height: var(--swatch-size, 350px);
50
+ width: 100%;
51
+ border-radius: calc(var(--swatch-size, 350px) / 2);
52
+ }
53
+
54
+ .color-swatch--grid {
55
+ width: 100%;
56
+ height: var(--swatch-size, 300px);
57
+ min-width: var(--swatch-grid-min-width, 165px);
58
+ border-radius: var(--cx-border-radius-x-large);
59
+ }
60
+
61
+ .color-swatch__content {
62
+ max-height: 100%;
63
+ padding: var(--swatch-content-padding, 0);
64
+ justify-content: space-between;
65
+ gap: var(--cx-spacing-medium);
66
+ }
67
+
68
+ .color-swatch--circle > .color-swatch__content {
69
+ max-width: 75%;
70
+ min-width: 50%;
71
+ }
72
+
73
+ .color-swatch--oval > .color-swatch__content {
74
+ max-width: 85%;
75
+ }
76
+
77
+ .color-swatch--grid > .color-swatch__content {
78
+ height: 100%;
79
+ width: 100%;
80
+ padding: var(--cx-spacing-large) var(--cx-spacing-medium);
81
+ }
82
+
83
+ .color-swatch__key::part(base) {
84
+ min-width: 50px;
85
+ height: 100%;
86
+ vertical-align: middle;
87
+ }
88
+
89
+ .color-swatch__key[variant='small']::part(base) {
90
+ display: inline-block;
91
+ }
92
+
93
+ .color-swatch__copy-button::part(button) {
94
+ min-height: fit-content;
95
+ height: fit-content;
96
+ border-width: 0 !important;
97
+ background: transparent !important;
98
+ padding: 0;
99
+ }
100
+
101
+ .color-swatch__copy-button::part(label) {
102
+ height: fit-content;
103
+ padding: 0;
104
+ }
105
+
106
+ .color-swatch__value {
107
+ text-transform: none;
108
+ }
109
+
110
+ .color-swatch__value::part(base) {
111
+ word-break: break-word;
112
+ }
113
+
114
+ .color-swatch__value-wrapper {
115
+ text-align: left;
116
+ }
117
+ `;
118
+ var V = Object.defineProperty, B = Object.getOwnPropertyDescriptor, e = (o, r, y, d) => {
119
+ for (var s = d > 1 ? void 0 : d ? B(r, y) : r, C = o.length - 1, m; C >= 0; C--)
120
+ (m = o[C]) && (s = (d ? m(r, y, s) : m(s)) || s);
121
+ return d && s && V(r, y, s), s;
122
+ };
123
+ let t = class extends k {
124
+ constructor() {
125
+ super(...arguments), this.localize = new A(this), this.ignoreWatchColorChange = /* @__PURE__ */ new Set(), this.variant = p.Circle, this.name = "", this.hex = "", this.rgb = "", this.cmyk = "", this.pms = "", this.canCopy = !1, this.showCodes = ["HEX", "RGB", "CMYK", "PMS"], this.canFocusCodeOnly = !1, this.noAutoConvert = !1, this.textColor = "#27272A", this.textVariant = "body2", this.lineClamp = 3, this.backgroundColor = "#F9F9F9", this.canFocusContainer = !0, this.isContainerFocused = !1;
126
+ }
127
+ runFirstUpdated() {
128
+ this.handleColorChange();
129
+ }
130
+ /**
131
+ * Change to default color
132
+ */
133
+ setDefaultColor() {
134
+ this.backgroundColor = "#F9F9F9", this.textColor = "#27272A";
135
+ }
136
+ handleResize() {
137
+ const o = this.containerEl.offsetWidth;
138
+ o > 315 || this.variant === "grid-item" ? (this.textVariant = "body2", this.rowGap = "x-small", this.lineClamp = 3) : o > 230 ? (this.textVariant = "body3", this.rowGap = "2x-small", this.lineClamp = 2) : (this.textVariant = "small", this.rowGap = "3x-small", this.lineClamp = 1);
139
+ }
140
+ handleVariantChange() {
141
+ this.containerEl && this.handleResize();
142
+ }
143
+ handleCmykChange() {
144
+ if (!this.noAutoConvert) {
145
+ if (this.ignoreWatchColorChange.has("cmyk") || this.cmyk === "" && !this.hasUpdated) {
146
+ this.ignoreWatchColorChange.delete("cmyk");
147
+ return;
148
+ }
149
+ this.ignoreWatchColorChange.add("hex"), this.ignoreWatchColorChange.add("rgb"), this.hex = n(this.cmyk, h.Hex), this.rgb = n(this.cmyk, h.Rgb);
150
+ }
151
+ }
152
+ handleRGBChange() {
153
+ if (!this.noAutoConvert) {
154
+ if (this.ignoreWatchColorChange.has("rgb") || this.rgb === "" && !this.hasUpdated) {
155
+ this.ignoreWatchColorChange.delete("rgb");
156
+ return;
157
+ }
158
+ this.ignoreWatchColorChange.add("hex"), this.ignoreWatchColorChange.add("cmyk"), this.hex = n(this.rgb, h.Hex), this.cmyk = n(this.rgb, h.Cmyk);
159
+ }
160
+ }
161
+ handleHexChange() {
162
+ if (!this.noAutoConvert) {
163
+ if (this.ignoreWatchColorChange.has("hex") || this.hex === "" && !this.hasUpdated) {
164
+ this.ignoreWatchColorChange.delete("hex");
165
+ return;
166
+ }
167
+ this.ignoreWatchColorChange.add("rgb"), this.ignoreWatchColorChange.add("cmyk"), this.rgb = n(this.hex, h.Rgb), this.cmyk = n(this.hex, h.Cmyk);
168
+ }
169
+ }
170
+ async handleColorChange() {
171
+ await this.updateComplete, this.hex && $.test(this.hex) ? (this.textColor = z(this.hex, "#27272A", "#F9F9F9"), this.backgroundColor = this.hex) : this.setDefaultColor();
172
+ }
173
+ handleCanFocusCodeOnlyChange() {
174
+ this.isContainerFocused || (this.canFocusContainer = !this.canFocusCodeOnly);
175
+ }
176
+ handleFocusIn() {
177
+ this.isContainerFocused = !0;
178
+ }
179
+ handleFocusOut() {
180
+ this.isContainerFocused = !1;
181
+ }
182
+ render() {
183
+ const o = [
184
+ { key: "HEX", value: this.hex },
185
+ { key: "RGB", value: this.rgb },
186
+ { key: "CMYK", value: this.cmyk },
187
+ { key: "PMS", value: this.pms }
188
+ ].filter((r) => this.showCodes.includes(r.key));
189
+ return u`
190
+ <cx-resize-observer @cx-resize=${this.handleResize}>
191
+ <div
192
+ part="base"
193
+ tabindex=${x(this.canFocusContainer ? "0" : void 0)}
194
+ class=${g({
195
+ "color-swatch": !0,
196
+ "color-swatch--circle": this.variant === p.Circle,
197
+ "color-swatch--grid": this.variant === p.GridItem,
198
+ "color-swatch--oval": this.variant === p.Oval
199
+ })}
200
+ style=${l({
201
+ backgroundColor: this.backgroundColor
202
+ })}
203
+ @focusin=${this.handleFocusIn}
204
+ @focusout=${this.handleFocusOut}
205
+ >
206
+ <cx-space
207
+ part="content"
208
+ direction="vertical"
209
+ class="color-swatch__content"
210
+ >
211
+ <cx-typography
212
+ variant="h5"
213
+ part="name"
214
+ style=${l({
215
+ "--color": this.textColor
216
+ })}
217
+ >
218
+ ${this.name}
219
+ </cx-typography>
220
+ <cx-space
221
+ direction="vertical"
222
+ spacing=${this.rowGap}
223
+ part="content"
224
+ >
225
+ ${U(
226
+ o,
227
+ (r) => r.key,
228
+ (r) => u`<cx-space
229
+ direction="horizontal"
230
+ align-items="center"
231
+ spacing="small"
232
+ part="item"
233
+ wrap="nowrap"
234
+ >
235
+ <cx-typography
236
+ variant=${this.textVariant}
237
+ class="color-swatch__key"
238
+ part="key"
239
+ style=${l({
240
+ "--color": this.textColor
241
+ })}
242
+ >
243
+ ${r.key}
244
+ </cx-typography>
245
+ ${E(
246
+ this.canCopy && r.value !== "",
247
+ () => u`
248
+ <cx-copy-button
249
+ part="copy-button"
250
+ tabindex=${x(
251
+ this.canFocusCodeOnly ? void 0 : "-1"
252
+ )}
253
+ class="color-swatch__copy-button"
254
+ copy-label=${this.localize.term("clickToCopy")}
255
+ focus-copy-label=${this.localize.term(
256
+ "pressEnterOrCtrlCToCopy"
257
+ )}
258
+ label=${`${r.key} ${r.value}`}
259
+ no-icon
260
+ value=${r.value}
261
+ >
262
+ <cx-line-clamp
263
+ lines=${this.lineClamp}
264
+ disabled-tooltip
265
+ class=${g({
266
+ "color-swatch__value-wrapper": !0
267
+ })}
268
+ >
269
+ <cx-typography
270
+ variant=${this.textVariant}
271
+ style=${l({
272
+ "--color": this.textColor
273
+ })}
274
+ class="color-swatch__value"
275
+ part="value"
276
+ >
277
+ ${r.value}
278
+ </cx-typography>
279
+ </cx-line-clamp>
280
+ </cx-copy-button>
281
+ `,
282
+ () => u`
283
+ <cx-line-clamp
284
+ lines=${this.lineClamp}
285
+ disabled-tooltip
286
+ class="color-swatch__value-wrapper"
287
+ >
288
+ <cx-typography
289
+ variant=${this.textVariant}
290
+ style=${l({
291
+ "--color": this.textColor
292
+ })}
293
+ class="color-swatch__value"
294
+ part="value"
295
+ >
296
+ ${r.value}
297
+ </cx-typography>
298
+ </cx-line-clamp>
299
+ `
300
+ )}
301
+ </cx-space>`
302
+ )}
303
+ </cx-space>
304
+ </cx-space>
305
+ </div>
306
+ </cx-resize-observer>
307
+ `;
308
+ }
309
+ };
310
+ t.styles = [F, S];
311
+ t.dependencies = {
312
+ "cx-copy-button": v,
313
+ "cx-line-clamp": f,
314
+ "cx-resize-observer": w,
315
+ "cx-space": b,
316
+ "cx-typography": _
317
+ };
318
+ e([
319
+ R(".color-swatch")
320
+ ], t.prototype, "containerEl", 2);
321
+ e([
322
+ a({ reflect: !0, type: String })
323
+ ], t.prototype, "variant", 2);
324
+ e([
325
+ a({ reflect: !0, type: String })
326
+ ], t.prototype, "name", 2);
327
+ e([
328
+ a({ reflect: !0, type: String })
329
+ ], t.prototype, "hex", 2);
330
+ e([
331
+ a({ reflect: !0, type: String })
332
+ ], t.prototype, "rgb", 2);
333
+ e([
334
+ a({ reflect: !0, type: String })
335
+ ], t.prototype, "cmyk", 2);
336
+ e([
337
+ a({ reflect: !0, type: String })
338
+ ], t.prototype, "pms", 2);
339
+ e([
340
+ a({ attribute: "can-copy", reflect: !0, type: Boolean })
341
+ ], t.prototype, "canCopy", 2);
342
+ e([
343
+ a({
344
+ attribute: "show-codes",
345
+ converter: {
346
+ fromAttribute: (o) => o?.split(" ") ?? [],
347
+ toAttribute: (o) => o.join(" ")
348
+ }
349
+ })
350
+ ], t.prototype, "showCodes", 2);
351
+ e([
352
+ a({ attribute: "can-focus-code-only", reflect: !0, type: Boolean })
353
+ ], t.prototype, "canFocusCodeOnly", 2);
354
+ e([
355
+ a({ attribute: "no-auto-convert", reflect: !0, type: Boolean })
356
+ ], t.prototype, "noAutoConvert", 2);
357
+ e([
358
+ c()
359
+ ], t.prototype, "textColor", 2);
360
+ e([
361
+ c()
362
+ ], t.prototype, "textVariant", 2);
363
+ e([
364
+ c()
365
+ ], t.prototype, "rowGap", 2);
366
+ e([
367
+ c()
368
+ ], t.prototype, "lineClamp", 2);
369
+ e([
370
+ c()
371
+ ], t.prototype, "backgroundColor", 2);
372
+ e([
373
+ c()
374
+ ], t.prototype, "canFocusContainer", 2);
375
+ e([
376
+ c()
377
+ ], t.prototype, "isContainerFocused", 2);
378
+ e([
379
+ W(50)
380
+ ], t.prototype, "handleResize", 1);
381
+ e([
382
+ i("variant")
383
+ ], t.prototype, "handleVariantChange", 1);
384
+ e([
385
+ i("cmyk")
386
+ ], t.prototype, "handleCmykChange", 1);
387
+ e([
388
+ i("rgb")
389
+ ], t.prototype, "handleRGBChange", 1);
390
+ e([
391
+ i("hex")
392
+ ], t.prototype, "handleHexChange", 1);
393
+ e([
394
+ i("hex", { waitUntilFirstUpdate: !0 }),
395
+ i("rgb", { waitUntilFirstUpdate: !0 }),
396
+ i("cmyk", { waitUntilFirstUpdate: !0 })
397
+ ], t.prototype, "handleColorChange", 1);
398
+ e([
399
+ i("canFocusCodeOnly", { waitUntilFirstUpdate: !0 })
400
+ ], t.prototype, "handleCanFocusCodeOnlyChange", 1);
401
+ t = e([
402
+ O("cx-color-swatch")
403
+ ], t);
404
+ export {
405
+ t as C,
406
+ p as a
407
+ };
@@ -0,0 +1,164 @@
1
+ import { T as l } from "./index.C1chwzNp.js";
2
+ var k = /* @__PURE__ */ ((r) => (r.Cmyk = "cmyk", r.Hex = "hex", r.Rgb = "rgb", r.Unknown = "unknown", r))(k || {});
3
+ const p = /^#([0-9A-Fa-f]{3}){1,2}$/, $ = /^(\s*(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)\s*,){2}\s*(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)\s*$/, x = /^(\s*(100|[1-9]?\d)\s*,){3}\s*(100|[1-9]?\d)\s*$/, y = /^#(?:[0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/;
4
+ function b(r) {
5
+ return p.test(r) ? "hex" : $.test(r) ? "rgb" : x.test(r) ? "cmyk" : "unknown";
6
+ }
7
+ function d(r, c, n) {
8
+ return "#" + [r, c, n].map((a) => a.toString(16).padStart(2, "0")).join("").toUpperCase();
9
+ }
10
+ function g(r) {
11
+ r = r.trim().replace(/^#/, ""), r.length === 8 && (r = r.slice(0, 6)), r.length === 3 && (r = r.split("").map((n) => n + n).join(""));
12
+ const c = parseInt(r, 16);
13
+ return {
14
+ b: c & 255,
15
+ g: c >> 8 & 255,
16
+ r: c >> 16 & 255
17
+ };
18
+ }
19
+ function h(r, c, n) {
20
+ const a = 1 - r / 255, t = 1 - c / 255, e = 1 - n / 255, s = Math.min(a, t, e);
21
+ return s === 1 ? { c: 0, k: 100, m: 0, y: 0 } : {
22
+ c: Math.round((a - s) / (1 - s) * 100),
23
+ k: Math.round(s * 100),
24
+ m: Math.round((t - s) / (1 - s) * 100),
25
+ y: Math.round((e - s) / (1 - s) * 100)
26
+ };
27
+ }
28
+ function m(r, c, n, a) {
29
+ const t = 255 * (1 - r / 100) * (1 - a / 100), e = 255 * (1 - c / 100) * (1 - a / 100), s = 255 * (1 - n / 100) * (1 - a / 100);
30
+ return { b: Math.round(s), g: Math.round(e), r: Math.round(t) };
31
+ }
32
+ function I(r) {
33
+ switch (r = r.trim(), b(r)) {
34
+ case "hex":
35
+ return { hex: r };
36
+ case "rgb": {
37
+ const n = r.split(",").map((a) => a.trim());
38
+ return {
39
+ blue: parseInt(n[2], 10),
40
+ green: parseInt(n[1], 10),
41
+ red: parseInt(n[0], 10)
42
+ };
43
+ }
44
+ case "cmyk": {
45
+ const n = r.split(",").map((a) => a.trim());
46
+ return {
47
+ c: parseInt(n[0], 10),
48
+ k: parseInt(n[3], 10),
49
+ m: parseInt(n[1], 10),
50
+ y: parseInt(n[2], 10)
51
+ };
52
+ }
53
+ default:
54
+ return {};
55
+ }
56
+ }
57
+ function C(r, c, n) {
58
+ const a = b(r), t = I(r);
59
+ let e = {};
60
+ if (a === "unknown")
61
+ return "";
62
+ if (a === c && !n)
63
+ return r;
64
+ switch (c) {
65
+ case "hex":
66
+ if (a === "rgb")
67
+ e.hex = d(t.red, t.green, t.blue);
68
+ else if (a === "cmyk") {
69
+ const s = m(t.c, t.m, t.y, t.k);
70
+ e.hex = d(s.r, s.g, s.b);
71
+ } else
72
+ e.hex = t.hex;
73
+ break;
74
+ case "rgb":
75
+ if (a === "hex") {
76
+ const s = g(t.hex);
77
+ e.red = s.r, e.green = s.g, e.blue = s.b;
78
+ } else if (a === "cmyk") {
79
+ const s = m(t.c, t.m, t.y, t.k);
80
+ e.red = s.r, e.green = s.g, e.blue = s.b;
81
+ } else
82
+ Object.assign(e, t);
83
+ break;
84
+ case "cmyk":
85
+ if (a === "rgb")
86
+ e = h(t.red, t.green, t.blue);
87
+ else if (a === "hex") {
88
+ const s = g(t.hex);
89
+ e = h(s.r, s.g, s.b);
90
+ } else
91
+ Object.assign(e, t);
92
+ break;
93
+ default:
94
+ return r;
95
+ }
96
+ return n ? n.replace(/\$\{(.*?)\}/g, (s, i) => i in e ? String(e[i]) : "") : c === "hex" ? e.hex : c === "rgb" ? `${e.red}, ${e.green}, ${e.blue}` : c === "cmyk" ? `${e.c}, ${e.m}, ${e.y}, ${e.k}` : r;
97
+ }
98
+ function E(r, c = "#000", n = "#FFF") {
99
+ if (!((u) => y.test(u))(r))
100
+ return r;
101
+ const { b: t, g: e, r: s } = g(r);
102
+ return 0.299 * s + 0.587 * e + 0.114 * t > 186 ? c : n;
103
+ }
104
+ function A(r) {
105
+ const c = "light-dark", n = r.toLowerCase().indexOf(c + "(");
106
+ if (n === -1)
107
+ return "";
108
+ const a = r.indexOf("(", n + c.length);
109
+ if (a === -1)
110
+ return "";
111
+ let t = 0, e = -1, s = -1;
112
+ for (let o = a; o < r.length; o++) {
113
+ const f = r[o];
114
+ if (f === "(") {
115
+ t++;
116
+ continue;
117
+ }
118
+ if (f === ")") {
119
+ if (t--, t === 0) {
120
+ s = o;
121
+ break;
122
+ }
123
+ continue;
124
+ }
125
+ f === "," && t === 1 && e === -1 && (e = o);
126
+ }
127
+ if (e === -1 || s === -1)
128
+ return "";
129
+ const i = r.slice(a + 1, e).trim(), u = r.slice(e + 1, s).trim();
130
+ return `${i} ${u}`;
131
+ }
132
+ function M(r, c) {
133
+ const n = new l(r), a = new l(c), t = n.isValid ? r : "transparent", e = a.isValid ? c : "transparent";
134
+ return `light-dark(${t}, ${e})`;
135
+ }
136
+ function _(r) {
137
+ const c = A(r);
138
+ if (!c)
139
+ return null;
140
+ const n = r.replace(/light-dark\([^()]*(?:\([^()]*\)[^()]*)*\)/i, "").trim();
141
+ return `${c} ${n}`;
142
+ }
143
+ function L(r) {
144
+ const c = r.match(/([a-zA-Z-]+\([^)]*\))/);
145
+ if (!c)
146
+ return "";
147
+ const n = c[1], a = n.replace(/^[a-zA-Z-]+\(|\)$/g, "").trim(), t = r.replace(n, "").trim(), e = a.replace(/,/g, "").trim();
148
+ return `${t} ${e}`;
149
+ }
150
+ export {
151
+ k as C,
152
+ p as H,
153
+ $ as R,
154
+ A as a,
155
+ L as b,
156
+ C as c,
157
+ x as d,
158
+ y as e,
159
+ b as f,
160
+ M as g,
161
+ I as h,
162
+ E as l,
163
+ _ as p
164
+ };
@@ -1,4 +1,4 @@
1
- import { i as t } from "./custom-element.vnXBMQxc.js";
1
+ import { i as t } from "./lit-element.jLBm65_O.js";
2
2
  const o = t`
3
3
  :host {
4
4
  box-sizing: border-box;
@@ -1,14 +1,16 @@
1
- import { C as _ } from "./button.CtCSNRB3.js";
2
- import { C as u, D as h } from "./dialog.B1TORO6S.js";
1
+ import { C as _ } from "./button.P71VJ5xh.js";
2
+ import { C as u, D as h } from "./dialog.C_75RVVz.js";
3
3
  import g from "../components/dropdown.js";
4
- import { C as x } from "./typography.BFpl0WMA.js";
5
- import { i as b, n as e, C as y, x as d, c as w } from "./custom-element.vnXBMQxc.js";
6
- import { c as $ } from "./component.styles.CI-v8BZa.js";
7
- import { L as z } from "./i18n.BP2FRO1v.js";
4
+ import { C as x } from "./typography.oDzoLbZS.js";
5
+ import { n as e, C as b } from "./lib-cortex-element.CVMmyPMC.js";
6
+ import { c as y } from "./component.styles.DMSLciL5.js";
7
+ import { c as w } from "./custom-element.L4WJXn1j.js";
8
+ import { L as $ } from "./i18n.DrzK7TPf.js";
9
+ import { i as z, x as d } from "./lit-element.jLBm65_O.js";
8
10
  import { e as m } from "./query.BBf1UFkC.js";
9
- import { e as a } from "./class-map.CoZTSvbM.js";
10
- var v = /* @__PURE__ */ ((t) => (t.Horizontal = "horizontal", t.HorizontalReverse = "horizontal-reverse", t.Vertical = "vertical", t.VerticalReverse = "vertical-reverse", t))(v || {}), f = /* @__PURE__ */ ((t) => (t.Center = "center", t.End = "end", t.Start = "start", t))(f || {});
11
- const S = b`
11
+ import { e as a } from "./class-map.BiVq-cVR.js";
12
+ var f = /* @__PURE__ */ ((t) => (t.Horizontal = "horizontal", t.HorizontalReverse = "horizontal-reverse", t.Vertical = "vertical", t.VerticalReverse = "vertical-reverse", t))(f || {}), v = /* @__PURE__ */ ((t) => (t.Center = "center", t.End = "end", t.Start = "start", t))(v || {});
13
+ const S = z`
12
14
  .confirm-popover--dropdown .confirm-popover__dropdown-content {
13
15
  display: flex;
14
16
  flex-direction: column;
@@ -106,9 +108,9 @@ var D = Object.defineProperty, C = Object.getOwnPropertyDescriptor, r = (t, n, s
106
108
  (l = t[p]) && (i = (c ? l(n, s, i) : l(i)) || i);
107
109
  return c && i && D(n, s, i), i;
108
110
  };
109
- let o = class extends y {
111
+ let o = class extends b {
110
112
  constructor() {
111
- super(...arguments), this.localize = new z(this), this.message = "", this.disabled = !1, this.buttonsDirection = v.Horizontal, this.buttonsAlignment = f.End, this.dividerPosition = h.Header, this.dialogLabel = "", this.confirmText = "", this.cancelText = "", this.variant = "dropdown", this.boundary = document.body;
113
+ super(...arguments), this.localize = new $(this), this.message = "", this.disabled = !1, this.buttonsDirection = f.Horizontal, this.buttonsAlignment = v.End, this.dividerPosition = h.Header, this.dialogLabel = "", this.confirmText = "", this.cancelText = "", this.variant = "dropdown", this.boundary = document.body;
112
114
  }
113
115
  get open() {
114
116
  return this.variant === "dialog" ? this.dialog.open : this.dropdown.open;
@@ -234,7 +236,7 @@ let o = class extends y {
234
236
  return this.variant === "dialog" ? this.renderDialog() : this.renderDropdown();
235
237
  }
236
238
  };
237
- o.styles = [$, S];
239
+ o.styles = [y, S];
238
240
  o.dependencies = {
239
241
  "cx-button": _,
240
242
  "cx-dialog": u,
@@ -282,5 +284,5 @@ o = r([
282
284
  ], o);
283
285
  export {
284
286
  o as C,
285
- v as a
287
+ f as a
286
288
  };
@@ -1,4 +1,4 @@
1
- import { c as t } from "./capitalize.CNStXZBq.js";
1
+ import { c as t } from "./capitalize.WSkCXkNE.js";
2
2
  var n = /* @__PURE__ */ ((a) => (a.Desktop = "desktop", a.Mobile = "mobile", a.Tablet = "tablet", a))(n || {});
3
3
  const e = {
4
4
  canvasWidth: "",
@@ -0,0 +1,11 @@
1
+ const i = {
2
+ fromAttribute: (r) => r?.split(" ").map((t) => {
3
+ const e = Number.parseFloat(t);
4
+ if (!Number.isNaN(e))
5
+ return e;
6
+ }).filter((t) => t !== void 0) ?? [],
7
+ toAttribute: (r) => Array.isArray(r) ? r.join(" ").trim() : ""
8
+ };
9
+ export {
10
+ i as t
11
+ };