@brightspot/ui 1.0.1-wc.4 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/README.md +7 -90
  2. package/dist/LucideDynamicLoader.d.ts +1 -0
  3. package/dist/LucideDynamicLoader.d.ts.map +1 -1
  4. package/dist/LucideDynamicLoader.js +2 -0
  5. package/dist/LucideDynamicLoader.js.map +1 -1
  6. package/dist/LucideDynamicLoader.ts +3 -0
  7. package/dist/components/avatar/Avatar.d.ts +82 -0
  8. package/dist/components/avatar/Avatar.d.ts.map +1 -0
  9. package/dist/components/avatar/Avatar.js +162 -0
  10. package/dist/components/avatar/Avatar.js.map +1 -0
  11. package/dist/components/avatar/AvatarGroup.d.ts +70 -0
  12. package/dist/components/avatar/AvatarGroup.d.ts.map +1 -0
  13. package/dist/components/avatar/AvatarGroup.js +145 -0
  14. package/dist/components/avatar/AvatarGroup.js.map +1 -0
  15. package/dist/components/badge/Badge.d.ts +75 -0
  16. package/dist/components/badge/Badge.d.ts.map +1 -0
  17. package/dist/components/badge/Badge.js +118 -0
  18. package/dist/components/badge/Badge.js.map +1 -0
  19. package/dist/components/circular-progress/CircularProgress.d.ts +57 -0
  20. package/dist/components/circular-progress/CircularProgress.d.ts.map +1 -0
  21. package/dist/components/circular-progress/CircularProgress.js +173 -0
  22. package/dist/components/circular-progress/CircularProgress.js.map +1 -0
  23. package/dist/components/icon/Icon.d.ts +90 -0
  24. package/dist/components/icon/Icon.d.ts.map +1 -0
  25. package/dist/components/icon/Icon.js +172 -0
  26. package/dist/components/icon/Icon.js.map +1 -0
  27. package/dist/components/linear-progress/LinearProgress.d.ts +40 -0
  28. package/dist/components/linear-progress/LinearProgress.d.ts.map +1 -0
  29. package/dist/components/linear-progress/LinearProgress.js +95 -0
  30. package/dist/components/linear-progress/LinearProgress.js.map +1 -0
  31. package/dist/custom-elements.json +772 -0
  32. package/dist/global.d.ts +4 -0
  33. package/dist/storybook/assets/Avatar.stories-BlxrclP0.js +209 -0
  34. package/dist/storybook/assets/AvatarGroup.stories-E3VUvBae.js +211 -0
  35. package/dist/storybook/assets/Badge.stories-f4YvPz0W.js +121 -0
  36. package/dist/storybook/assets/Button.stories-N66xrq4q.js +63 -0
  37. package/dist/storybook/assets/CircularProgress.stories-zWyELtfc.js +451 -0
  38. package/dist/storybook/assets/{Color-64QXVMR3-BV_8WWIP.js → Color-64QXVMR3-B3Y5c9dl.js} +1 -1
  39. package/dist/storybook/assets/{Colors.stories-CcpJ2Txp.js → Colors.stories-nEoNeHhf.js} +1 -1
  40. package/dist/storybook/assets/Events.stories-BP3ensxX.js +108 -0
  41. package/dist/storybook/assets/Heading.stories-DGqWaBpi.js +3 -0
  42. package/dist/storybook/assets/Icon.stories-BWWjh4NZ.js +245 -0
  43. package/dist/storybook/assets/LinearProgress.stories-DMVolkoE.js +397 -0
  44. package/dist/storybook/assets/ReadyMixin.stories-DavcxbQ0.js +55 -0
  45. package/dist/storybook/assets/ScrollShadow.stories-BmwSRNje.js +17 -0
  46. package/dist/storybook/assets/Throttle.stories-DBj-9rhV.js +303 -0
  47. package/dist/storybook/assets/{WithTooltip-SK46ZJ2J-DyavE1Bj.js → WithTooltip-SK46ZJ2J-DW4NXFWt.js} +5 -5
  48. package/dist/storybook/assets/formatter-OMEEQ6HG-BBn014aZ.js +1 -0
  49. package/dist/storybook/assets/iframe-CxsKJSj-.css +1 -0
  50. package/dist/storybook/assets/{iframe-mIh0R_Av.js → iframe-Z4F0Cgki.js} +87 -100
  51. package/dist/storybook/assets/{index-C8IjQgz6.js → index-BUj5S-B7.js} +1 -1
  52. package/dist/storybook/assets/{syntaxhighlighter-CAVLW7PM-36bUIV4n.js → syntaxhighlighter-CAVLW7PM-CsQveU1N.js} +1 -1
  53. package/dist/storybook/iframe.html +2 -2
  54. package/dist/storybook/index.json +1 -1
  55. package/dist/storybook/project.json +1 -1
  56. package/dist/tailwind-plugin-avatar.d.ts +2 -0
  57. package/dist/tailwind-plugin-avatar.d.ts.map +1 -0
  58. package/dist/tailwind-plugin-avatar.js +130 -0
  59. package/dist/tailwind-plugin-avatar.js.map +1 -0
  60. package/dist/tailwind-plugin-avatar.ts +181 -0
  61. package/dist/tailwind-plugin-badge.js +24 -9
  62. package/dist/tailwind-plugin-badge.js.map +1 -1
  63. package/dist/tailwind-plugin-badge.ts +30 -11
  64. package/dist/tailwind-plugin-button.js +14 -15
  65. package/dist/tailwind-plugin-button.js.map +1 -1
  66. package/dist/tailwind-plugin-button.ts +14 -17
  67. package/dist/tailwind-plugin-contrast.d.ts +2 -0
  68. package/dist/tailwind-plugin-contrast.d.ts.map +1 -0
  69. package/dist/tailwind-plugin-contrast.js +17 -0
  70. package/dist/tailwind-plugin-contrast.js.map +1 -0
  71. package/dist/tailwind-plugin-contrast.ts +18 -0
  72. package/dist/tailwind-plugin-icon.js +17 -10
  73. package/dist/tailwind-plugin-icon.js.map +1 -1
  74. package/dist/tailwind-plugin-icon.ts +17 -10
  75. package/dist/tailwind-plugin-ring-contrast.d.ts +2 -0
  76. package/dist/tailwind-plugin-ring-contrast.d.ts.map +1 -0
  77. package/dist/tailwind-plugin-ring-contrast.js +76 -0
  78. package/dist/tailwind-plugin-ring-contrast.js.map +1 -0
  79. package/dist/tailwind-plugin-ring-contrast.ts +90 -0
  80. package/dist/tailwind.config.d.ts +21 -0
  81. package/dist/tailwind.config.d.ts.map +1 -1
  82. package/dist/tailwind.config.js +27 -2
  83. package/dist/tailwind.config.js.map +1 -1
  84. package/dist/tailwind.config.ts +27 -2
  85. package/dist/{utils → util}/EventEmitterMixin.d.ts +23 -17
  86. package/dist/util/EventEmitterMixin.d.ts.map +1 -0
  87. package/dist/{utils → util}/EventEmitterMixin.js +7 -7
  88. package/dist/util/EventEmitterMixin.js.map +1 -0
  89. package/dist/util/ProgressMixin.d.ts +52 -0
  90. package/dist/util/ProgressMixin.d.ts.map +1 -0
  91. package/dist/util/ProgressMixin.js +190 -0
  92. package/dist/util/ProgressMixin.js.map +1 -0
  93. package/dist/util/ReadyMixin.d.ts +31 -0
  94. package/dist/util/ReadyMixin.d.ts.map +1 -0
  95. package/dist/util/ReadyMixin.js +42 -0
  96. package/dist/util/ReadyMixin.js.map +1 -0
  97. package/dist/util/aria.d.ts +3 -0
  98. package/dist/util/aria.d.ts.map +1 -0
  99. package/dist/util/aria.js +44 -0
  100. package/dist/util/aria.js.map +1 -0
  101. package/dist/util/svg.d.ts +9 -0
  102. package/dist/util/svg.d.ts.map +1 -1
  103. package/dist/util/svg.js +22 -0
  104. package/dist/util/svg.js.map +1 -1
  105. package/dist/util/throttle.d.ts +4 -0
  106. package/dist/util/throttle.d.ts.map +1 -0
  107. package/dist/util/throttle.js +30 -0
  108. package/dist/util/throttle.js.map +1 -0
  109. package/package.json +7 -6
  110. package/custom-elements.json +0 -214
  111. package/dist/components/widget/Widget.css +0 -118
  112. package/dist/components/widget/Widget.d.ts +0 -90
  113. package/dist/components/widget/Widget.d.ts.map +0 -1
  114. package/dist/components/widget/Widget.js +0 -196
  115. package/dist/components/widget/Widget.js.map +0 -1
  116. package/dist/components/widget/WidgetUtils.d.ts +0 -14
  117. package/dist/components/widget/WidgetUtils.d.ts.map +0 -1
  118. package/dist/components/widget/WidgetUtils.js +0 -42
  119. package/dist/components/widget/WidgetUtils.js.map +0 -1
  120. package/dist/storybook/assets/Badge.stories-cKvztBhm.js +0 -43
  121. package/dist/storybook/assets/Button.stories-BH3fEuOH.js +0 -63
  122. package/dist/storybook/assets/Heading.stories-cqZamo-6.js +0 -3
  123. package/dist/storybook/assets/Icon.stories-uPhO3RBG.js +0 -28543
  124. package/dist/storybook/assets/Loader.stories-D7Bl-LN9.js +0 -3
  125. package/dist/storybook/assets/ScrollShadow.stories-CWKYDYLk.js +0 -17
  126. package/dist/storybook/assets/Widget-CRTwFkFc.css +0 -1
  127. package/dist/storybook/assets/Widget.stories-CcjywoYR.js +0 -300
  128. package/dist/storybook/assets/formatter-OMEEQ6HG-DBJ97XaR.js +0 -1
  129. package/dist/storybook/assets/iframe-BdHEYpHD.css +0 -1
  130. package/dist/utils/EventEmitterMixin.d.ts.map +0 -1
  131. package/dist/utils/EventEmitterMixin.js.map +0 -1
@@ -0,0 +1,30 @@
1
+ /* eslint-disable prefer-rest-params */
2
+ export function throttle(interval, fn) {
3
+ if (interval <= 0) {
4
+ return fn;
5
+ }
6
+ let timeoutId;
7
+ let lastTrigger = 0;
8
+ return function () {
9
+ // Already scheduled to run.
10
+ if (timeoutId) {
11
+ return;
12
+ }
13
+ const now = Date.now();
14
+ const delay = interval - now + lastTrigger;
15
+ // Waited long enough so execute.
16
+ if (delay <= 0) {
17
+ lastTrigger = now;
18
+ fn.apply(this, [...arguments]);
19
+ }
20
+ else {
21
+ // Schedule for later.
22
+ timeoutId = setTimeout(() => {
23
+ lastTrigger = now;
24
+ timeoutId = undefined;
25
+ fn.apply(this, [...arguments]);
26
+ }, delay);
27
+ }
28
+ };
29
+ }
30
+ //# sourceMappingURL=throttle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"throttle.js","sourceRoot":"","sources":["../../src/util/throttle.ts"],"names":[],"mappings":"AAEA,uCAAuC;AACvC,MAAM,UAAU,QAAQ,CAAC,QAAgB,EAAE,EAAmB;IAC5D,IAAI,QAAQ,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,EAAE,CAAA;IACX,CAAC;IAED,IAAI,SAAoD,CAAA;IACxD,IAAI,WAAW,GAAG,CAAC,CAAA;IAEnB,OAAO;QACL,4BAA4B;QAC5B,IAAI,SAAS,EAAE,CAAC;YACd,OAAM;QACR,CAAC;QAED,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QACtB,MAAM,KAAK,GAAG,QAAQ,GAAG,GAAG,GAAG,WAAW,CAAA;QAE1C,iCAAiC;QACjC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;YACf,WAAW,GAAG,GAAG,CAAA;YACjB,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAA;QAChC,CAAC;aAAM,CAAC;YACN,sBAAsB;YACtB,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;gBAC1B,WAAW,GAAG,GAAG,CAAA;gBACjB,SAAS,GAAG,SAAS,CAAA;gBACrB,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAA;YAChC,CAAC,EAAE,KAAK,CAAC,CAAA;QACX,CAAC;IACH,CAAC,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@brightspot/ui",
3
- "version": "1.0.1-wc.4",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "description": "A UI library for building Brightspot CMS components.",
7
7
  "main": "./dist/tailwind.config.js",
8
- "customElements": "custom-elements.json",
8
+ "customElements": "dist/custom-elements.json",
9
9
  "exports": {
10
10
  ".": "./dist/tailwind.config.js",
11
11
  "./dist/*": "./dist/*",
12
- "./custom-elements.json": "./custom-elements.json"
12
+ "./custom-elements.json": "./dist/custom-elements.json"
13
13
  },
14
14
  "scripts": {
15
15
  "format": "prettier --write --ignore-unknown .",
@@ -34,6 +34,7 @@
34
34
  "@storybook/web-components-vite": "^10.0.6",
35
35
  "@tailwindcss/container-queries": "^0.1.1",
36
36
  "@types/node": "^24.10.0",
37
+ "@types/postcss-import": "^14.0.3",
37
38
  "@wc-toolkit/storybook-helpers": "^10.0.0",
38
39
  "autoprefixer": "10.4.21",
39
40
  "css-loader": "^6.7.1",
@@ -73,13 +74,13 @@
73
74
  "dist/components/**/*.js"
74
75
  ],
75
76
  "files": [
76
- "dist/**/*",
77
- "custom-elements.json"
77
+ "dist/**/*"
78
78
  ],
79
79
  "lint-staged": {
80
80
  "src/components/**/*.ts": [
81
81
  "node scripts/run-cem.cjs",
82
- "git add custom-elements.json"
82
+ "node scripts/generate-docs.mjs",
83
+ "git add docs/components/"
83
84
  ],
84
85
  "*": "yarn format"
85
86
  }
@@ -1,214 +0,0 @@
1
- {
2
- "schemaVersion": "1.0.0",
3
- "readme": "",
4
- "modules": [
5
- {
6
- "kind": "javascript-module",
7
- "path": "src/components/widget/Widget.ts",
8
- "declarations": [
9
- {
10
- "kind": "class",
11
- "description": "A collapsible container component with persistent state management.\n\nProvides collapsible behavior with localStorage persistence, keyboard\naccessibility, and automatic error expansion. Uses CSS Grid layout with\nnamed columns for flexible content positioning.",
12
- "name": "Widget",
13
- "cssProperties": [
14
- {
15
- "description": "Horizontal padding for grid columns (default: theme(spacing.6))",
16
- "name": "--space"
17
- },
18
- {
19
- "description": "Internal padding variable (default: var(--gap-l))",
20
- "name": "--Widget-padding"
21
- }
22
- ],
23
- "slots": [
24
- {
25
- "description": "Default slot for widget content",
26
- "name": ""
27
- }
28
- ],
29
- "members": [
30
- {
31
- "kind": "field",
32
- "name": "_collapsed",
33
- "type": {
34
- "text": "boolean"
35
- },
36
- "privacy": "private",
37
- "default": "false"
38
- },
39
- {
40
- "kind": "field",
41
- "name": "collapsible",
42
- "type": {
43
- "text": "boolean"
44
- },
45
- "default": "false",
46
- "description": "Enable collapsible behavior with expand/collapse controls.\nWhen enabled, displays a chevron icon and allows users to toggle content visibility.",
47
- "attribute": "collapsible"
48
- },
49
- {
50
- "kind": "field",
51
- "name": "heading",
52
- "type": {
53
- "text": "string | undefined"
54
- },
55
- "description": "Widget title displayed in the header.",
56
- "attribute": "heading"
57
- },
58
- {
59
- "kind": "field",
60
- "name": "internalname",
61
- "type": {
62
- "text": "string | undefined"
63
- },
64
- "description": "Internal identifier for localStorage key generation.\nUsed in format: BSP.ContentEdit.widgetCollapsed.{widgetid}.{internalname}",
65
- "attribute": "internalname"
66
- },
67
- {
68
- "kind": "field",
69
- "name": "invalid",
70
- "type": {
71
- "text": "boolean"
72
- },
73
- "default": "false",
74
- "description": "Internal state tracking whether widget contains error messages.\nWidget automatically expands when errors are detected.",
75
- "privacy": "private"
76
- },
77
- {
78
- "kind": "field",
79
- "name": "widgetid",
80
- "type": {
81
- "text": "string | undefined"
82
- },
83
- "description": "Widget type ID for localStorage key generation.\nCombined with internalname to create unique storage keys.",
84
- "attribute": "widgetid"
85
- },
86
- {
87
- "kind": "field",
88
- "name": "collapsed",
89
- "description": "Controls the collapsed state of the widget.\nWhen set, persists to localStorage and emits btu-widget-toggle event.",
90
- "attribute": "collapsed"
91
- },
92
- {
93
- "kind": "method",
94
- "name": "_collapsibleTemplate",
95
- "privacy": "private"
96
- }
97
- ],
98
- "events": [
99
- {
100
- "type": {
101
- "text": "CustomEvent"
102
- },
103
- "description": "Inherited from EventEmitterMixin, fired when element connects to DOM",
104
- "name": "btu-brightspot-element-connected"
105
- },
106
- {
107
- "type": {
108
- "text": "CustomEvent"
109
- },
110
- "description": "Inherited from EventEmitterMixin, fired when element disconnects from DOM",
111
- "name": "btu-brightspot-element-disconnected"
112
- },
113
- {
114
- "type": {
115
- "text": "CustomEvent<{error: Error}>"
116
- },
117
- "description": "Inherited from EventEmitterMixin, fired on connection error",
118
- "name": "btu-brightspot-element-error"
119
- },
120
- {
121
- "type": {
122
- "text": "CustomEvent"
123
- },
124
- "description": "Fired after first render and initialization",
125
- "name": "btu-widget-ready"
126
- },
127
- {
128
- "type": {
129
- "text": "CustomEvent<{collapsed: boolean}>"
130
- },
131
- "description": "Fired when collapse state changes",
132
- "name": "btu-widget-toggle"
133
- }
134
- ],
135
- "attributes": [
136
- {
137
- "name": "collapsible",
138
- "type": {
139
- "text": "boolean"
140
- },
141
- "default": "false",
142
- "description": "Enable collapsible behavior with expand/collapse controls.\nWhen enabled, displays a chevron icon and allows users to toggle content visibility.",
143
- "fieldName": "collapsible",
144
- "attribute": "collapsible"
145
- },
146
- {
147
- "name": "heading",
148
- "type": {
149
- "text": "string | undefined"
150
- },
151
- "description": "Widget title displayed in the header.",
152
- "fieldName": "heading",
153
- "attribute": "heading"
154
- },
155
- {
156
- "name": "internalname",
157
- "type": {
158
- "text": "string | undefined"
159
- },
160
- "description": "Internal identifier for localStorage key generation.\nUsed in format: BSP.ContentEdit.widgetCollapsed.{widgetid}.{internalname}",
161
- "fieldName": "internalname",
162
- "attribute": "internalname"
163
- },
164
- {
165
- "name": "widgetid",
166
- "type": {
167
- "text": "string | undefined"
168
- },
169
- "description": "Widget type ID for localStorage key generation.\nCombined with internalname to create unique storage keys.",
170
- "fieldName": "widgetid",
171
- "attribute": "widgetid"
172
- },
173
- {
174
- "name": "collapsed",
175
- "description": "Controls the collapsed state of the widget.\nWhen set, persists to localStorage and emits btu-widget-toggle event.",
176
- "fieldName": "collapsed",
177
- "attribute": "collapsed"
178
- }
179
- ],
180
- "mixins": [
181
- {
182
- "name": "EventEmitterMixin",
183
- "module": "/src/utils/EventEmitterMixin.js"
184
- }
185
- ],
186
- "superclass": {
187
- "name": "LitElement",
188
- "package": "lit"
189
- },
190
- "tagName": "btu-widget",
191
- "customElement": true
192
- }
193
- ],
194
- "exports": [
195
- {
196
- "kind": "js",
197
- "name": "default",
198
- "declaration": {
199
- "name": "Widget",
200
- "module": "src/components/widget/Widget.ts"
201
- }
202
- },
203
- {
204
- "kind": "custom-element-definition",
205
- "name": "btu-widget",
206
- "declaration": {
207
- "name": "Widget",
208
- "module": "src/components/widget/Widget.ts"
209
- }
210
- }
211
- ]
212
- }
213
- ]
214
- }
@@ -1,118 +0,0 @@
1
- .Widget {
2
- --Widget-padding: var(--gap-l);
3
- --space: theme(spacing.6);
4
-
5
- @apply [grid-template-columns:[fullbleed-start]_var(--space)_[content-start]_1fr_auto_[content-end]_var(--space)_[fullbleed-end]];
6
-
7
- > *:not(.ContentEdit-preview) {
8
- @apply [grid-column:content-start_/_content-end];
9
- }
10
- }
11
-
12
- .Widget-title {
13
- .Label {
14
- @apply inline-flex;
15
- }
16
- }
17
-
18
- .Widget-controls.is-locked {
19
- @apply !hidden;
20
- }
21
-
22
- .Widget:not(.is-collapsible) {
23
- &:has(.Widget-controls:not(:empty)) > .Widget-title {
24
- @apply pe-2 [grid-column:fullbleed-start_/_span_2];
25
- }
26
-
27
- /* widget controls appear on the top right corner of the widget on the same row as title */
28
- .Widget-controls {
29
- @apply pe-[--space] [grid-column:span_2_/_fullbleed-end] [grid-row:1];
30
- }
31
-
32
- /*
33
- Aligns Widget controls correctly with title for certain Admin Pages
34
- e.g. Restore button in Admin > User + Roles > Archived User,
35
- Widget controls in Admin > Sites & Settings > Archived Site
36
- */
37
- .Admin-main & .Widget-controls:has(> button:not(.FormFilter-icon)) {
38
- @apply -mt-[3.35rem] bg-white;
39
- }
40
- }
41
-
42
- .Widget-actionsToggle {
43
- @apply btu-button btu-button-text-hidden btu-button-fill-none btu-button-gray btu-button-sm before:btu-icon before:btu-icon-ellipsis;
44
- }
45
-
46
- .Widget-actionsList {
47
- @apply z-[10000];
48
- }
49
-
50
- .Widget-actions.is-open {
51
- .Widget-actionsToggle {
52
- @apply btu-button-pressed;
53
- }
54
- }
55
-
56
- .Widget
57
- :is(
58
- .widget-urls.is-readOnly,
59
- .widget-urlsRepeatable.is-readOnly,
60
- .ContentEditSites-owner.is-readOnly,
61
- .ContentEditSites-access.is-readOnly
62
- ) {
63
- @apply pointer-events-none select-none opacity-75;
64
- }
65
-
66
- .Widget .is-readOnly .UrlsWidget-itemLabel a,
67
- .widget .is-readOnly .RCIG-title:after,
68
- .widget .is-readOnly .ContentSummary-info,
69
- .widget .is-readOnly .ContentSelector-edit {
70
- @apply pointer-events-auto cursor-pointer;
71
- }
72
-
73
- /* Collapsible widgets where widget titles have expand/collapse controls (e.g. Right rail publishing tools)
74
- ** Note: In this use case Widget-controls are children of Widget-title instead of their sibling
75
- */
76
- .Widget.is-collapsible {
77
- .Widget-title:has(.Widget-expand:focus-visible) {
78
- @apply ring-primary-600 ring-offset-primary-100 ring-1 ring-inset ring-offset-4;
79
- }
80
- }
81
-
82
- /* TODO: Do we want to support this as a widget-part? */
83
- .Widget-heading {
84
- @apply py-2 text-sm font-semibold text-gray-900;
85
- }
86
-
87
- /* TODO: Do we want to support this as a widget-part? */
88
- .Widget-restoreButton {
89
- @apply btu-button btu-button-text-hidden btu-button-gray before:btu-icon before:btu-icon-archive-restore;
90
- }
91
-
92
- /* TODO: Do we want to support this as a widget-part? */
93
- .Widget-filters,
94
- .Widget-filter {
95
- @apply flex items-center justify-between;
96
- }
97
-
98
- .Widget-filters {
99
- @apply relative pt-3 before:absolute before:-inset-x-4 before:-inset-y-3 before:border-b before:border-b-gray-200 before:bg-gray-50;
100
- }
101
-
102
- .Widget-filter {
103
- @apply z-0 flex-row-reverse;
104
- }
105
-
106
- .Widget-filterLabel {
107
- @apply text-sm font-medium;
108
- }
109
-
110
- .Widget.is-collapsed {
111
- > div,
112
- > table {
113
- @apply hidden;
114
- }
115
- }
116
-
117
- /* The following code will need to be combed through to determine what styles should stay in bsp-ui and what should move back into cms tool-ui */
118
- /* See all the original styles for widgets in tool-ui ... */
@@ -1,90 +0,0 @@
1
- import { LitElement } from 'lit';
2
- export interface WidgetProps {
3
- collapsible?: boolean;
4
- heading?: string;
5
- internalname?: string;
6
- widgetid?: string;
7
- }
8
- declare const Widget_base: (new (...args: any[]) => import("../../utils/EventEmitterMixin.js").EventEmitterMixinInterface) & typeof LitElement;
9
- /**
10
- * A collapsible container component with persistent state management.
11
- *
12
- * Provides collapsible behavior with localStorage persistence, keyboard
13
- * accessibility, and automatic error expansion. Uses CSS Grid layout with
14
- * named columns for flexible content positioning.
15
- *
16
- * @element btu-widget
17
- *
18
- * @fires {CustomEvent} btu-brightspot-element-connected - Inherited from EventEmitterMixin, fired when element connects to DOM
19
- * @fires {CustomEvent} btu-brightspot-element-disconnected - Inherited from EventEmitterMixin, fired when element disconnects from DOM
20
- * @fires {CustomEvent<{error: Error}>} btu-brightspot-element-error - Inherited from EventEmitterMixin, fired on connection error
21
- * @fires {CustomEvent} btu-widget-ready - Fired after first render and initialization
22
- * @fires {CustomEvent<{collapsed: boolean}>} btu-widget-toggle - Fired when collapse state changes
23
- *
24
- * @slot - Default slot for widget content
25
- *
26
- * @cssprop --space - Horizontal padding for grid columns (default: theme(spacing.6))
27
- * @cssprop --Widget-padding - Internal padding variable (default: var(--gap-l))
28
- *
29
- * @example
30
- * ```html
31
- * <btu-widget
32
- * collapsible
33
- * heading="My Widget"
34
- * internalname="example"
35
- * widgetid="widget-001">
36
- * <p>Widget content goes here</p>
37
- * </btu-widget>
38
- * ```
39
- */
40
- export default class Widget extends Widget_base {
41
- private _collapsed;
42
- /**
43
- * Enable collapsible behavior with expand/collapse controls.
44
- * When enabled, displays a chevron icon and allows users to toggle content visibility.
45
- * @attr
46
- */
47
- collapsible: boolean;
48
- /**
49
- * Widget title displayed in the header.
50
- * @attr
51
- */
52
- heading?: string;
53
- /**
54
- * Internal identifier for localStorage key generation.
55
- * Used in format: BSP.ContentEdit.widgetCollapsed.{widgetid}.{internalname}
56
- * @attr
57
- */
58
- internalname?: string;
59
- /**
60
- * Internal state tracking whether widget contains error messages.
61
- * Widget automatically expands when errors are detected.
62
- * @private
63
- */
64
- invalid: boolean;
65
- /**
66
- * Widget type ID for localStorage key generation.
67
- * Combined with internalname to create unique storage keys.
68
- * @attr
69
- */
70
- widgetid?: string;
71
- /**
72
- * Controls the collapsed state of the widget.
73
- * When set, persists to localStorage and emits btu-widget-toggle event.
74
- * @attr
75
- */
76
- set collapsed(isCollapsed: boolean);
77
- get collapsed(): boolean;
78
- connectedCallback(): void;
79
- createRenderRoot(): this;
80
- firstUpdated(): void;
81
- private _collapsibleTemplate;
82
- render(): import("lit-html").TemplateResult<1>;
83
- }
84
- declare global {
85
- interface HTMLElementTagNameMap {
86
- 'btu-widget': Widget;
87
- }
88
- }
89
- export {};
90
- //# sourceMappingURL=Widget.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Widget.d.ts","sourceRoot":"","sources":["../../../src/components/widget/Widget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAA;AAStC,MAAM,WAAW,WAAW;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAA6B;IAC/D,OAAO,CAAC,UAAU,CAAQ;IAE1B;;;;OAIG;IAEH,WAAW,UAAQ;IAEnB;;;OAGG;IAEH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;;;OAIG;IAEH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;;OAIG;IAEH,OAAO,UAAQ;IAEf;;;;OAIG;IAEH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;;;OAIG;IACH,IACI,SAAS,CAAC,WAAW,EAAE,OAAO,EAcjC;IAED,IAAI,SAAS,IAhBc,OAAO,CAkBjC;IAED,iBAAiB,IAAI,IAAI;IAOzB,gBAAgB;IAIhB,YAAY,IAAI,IAAI;IAyBpB,OAAO,CAAC,oBAAoB;IAyC5B,MAAM;CAwBP;AAQD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,MAAM,CAAA;KACrB;CACF"}