@brightspot/ui 1.0.1-3 → 1.0.1-wc.1

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 (102) hide show
  1. package/README.md +75 -47
  2. package/custom-elements.json +214 -0
  3. package/dist/LucideDynamicLoader.d.ts +5 -0
  4. package/dist/LucideDynamicLoader.d.ts.map +1 -0
  5. package/dist/LucideDynamicLoader.js +2 -1
  6. package/dist/LucideDynamicLoader.js.map +1 -0
  7. package/dist/LucideDynamicLoader.ts +1 -1
  8. package/dist/components/widget/Widget.css +118 -0
  9. package/dist/components/widget/Widget.d.ts +90 -0
  10. package/dist/components/widget/Widget.d.ts.map +1 -0
  11. package/dist/components/widget/Widget.js +195 -0
  12. package/dist/components/widget/Widget.js.map +1 -0
  13. package/dist/components/widget/WidgetUtils.d.ts +14 -0
  14. package/dist/components/widget/WidgetUtils.d.ts.map +1 -0
  15. package/dist/components/widget/WidgetUtils.js +42 -0
  16. package/dist/components/widget/WidgetUtils.js.map +1 -0
  17. package/dist/global.d.ts +14 -0
  18. package/dist/storybook/assets/{Badge.stories-Dm-U1QYO.js → Badge.stories-BVaCGD8W.js} +3 -7
  19. package/dist/storybook/assets/{Button.stories-1cb_EUIC.js → Button.stories-C0BmUO4_.js} +2 -2
  20. package/dist/storybook/assets/Color-64QXVMR3-zezFbyuS.js +1 -0
  21. package/dist/storybook/assets/Colors.stories-CYFhcW5P.js +83 -0
  22. package/dist/storybook/assets/{Heading.stories-tM9cqImg.js → Heading.stories-8LPqm3WW.js} +1 -1
  23. package/dist/storybook/assets/{Icon.stories-BA6Sc9w5.js → Icon.stories-CpupdzrH.js} +1592 -9552
  24. package/dist/storybook/assets/Loader.stories-D0mnY_Z0.js +3 -0
  25. package/dist/storybook/assets/{ScrollShadow.stories-DKIcTQ1r.js → ScrollShadow.stories-BB4wF3c9.js} +1 -1
  26. package/dist/storybook/assets/Widget-CRTwFkFc.css +1 -0
  27. package/dist/storybook/assets/Widget.stories-yw3AloF5.js +323 -0
  28. package/dist/storybook/assets/WithTooltip-SK46ZJ2J-bOrMS36j.js +825 -0
  29. package/dist/storybook/assets/formatter-OMEEQ6HG-D2EXmNwo.js +1 -0
  30. package/dist/storybook/assets/iframe-BdHEYpHD.css +1 -0
  31. package/dist/storybook/assets/iframe-C5bTYo4K.js +1077 -0
  32. package/dist/storybook/assets/index-BLdw66Ec.js +1 -0
  33. package/dist/storybook/assets/syntaxhighlighter-CAVLW7PM-yrojVZDo.js +6 -0
  34. package/dist/storybook/iframe.html +4 -4
  35. package/dist/storybook/index.html +2 -13
  36. package/dist/storybook/index.json +1 -1
  37. package/dist/storybook/project.json +1 -1
  38. package/dist/storybook/sb-addons/docs-1/manager-bundle.js +1 -149
  39. package/dist/storybook/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +158 -323
  40. package/dist/storybook/sb-manager/globals-runtime.js +79814 -65954
  41. package/dist/storybook/sb-manager/globals.js +7 -16
  42. package/dist/storybook/sb-manager/runtime.js +15451 -9508
  43. package/dist/storybook/vite-inject-mocker-entry.js +1 -17
  44. package/dist/tailwind-plugin-badge.d.ts +2 -0
  45. package/dist/tailwind-plugin-badge.d.ts.map +1 -0
  46. package/dist/tailwind-plugin-badge.js +4 -3
  47. package/dist/tailwind-plugin-badge.js.map +1 -0
  48. package/dist/tailwind-plugin-badge.ts +4 -4
  49. package/dist/tailwind-plugin-button.d.ts +2 -0
  50. package/dist/tailwind-plugin-button.d.ts.map +1 -0
  51. package/dist/tailwind-plugin-button.js +20 -4
  52. package/dist/tailwind-plugin-button.js.map +1 -0
  53. package/dist/tailwind-plugin-button.ts +26 -20
  54. package/dist/tailwind-plugin-heading.d.ts +2 -0
  55. package/dist/tailwind-plugin-heading.d.ts.map +1 -0
  56. package/dist/tailwind-plugin-heading.js +1 -0
  57. package/dist/tailwind-plugin-heading.js.map +1 -0
  58. package/dist/tailwind-plugin-icon.d.ts +2 -0
  59. package/dist/tailwind-plugin-icon.d.ts.map +1 -0
  60. package/dist/tailwind-plugin-icon.js +15 -6
  61. package/dist/tailwind-plugin-icon.js.map +1 -0
  62. package/dist/tailwind-plugin-icon.ts +14 -7
  63. package/dist/tailwind-plugin-loader.d.ts +2 -0
  64. package/dist/tailwind-plugin-loader.d.ts.map +1 -0
  65. package/dist/tailwind-plugin-loader.js +1 -0
  66. package/dist/tailwind-plugin-loader.js.map +1 -0
  67. package/dist/tailwind-plugin-scroll-shadow.d.ts +2 -0
  68. package/dist/tailwind-plugin-scroll-shadow.d.ts.map +1 -0
  69. package/dist/tailwind-plugin-scroll-shadow.js +17 -2
  70. package/dist/tailwind-plugin-scroll-shadow.js.map +1 -0
  71. package/dist/tailwind-plugin-scroll-shadow.ts +34 -23
  72. package/dist/tailwind-plugin-theme.d.ts +2 -0
  73. package/dist/tailwind-plugin-theme.d.ts.map +1 -0
  74. package/dist/tailwind-plugin-theme.js +2 -3
  75. package/dist/tailwind-plugin-theme.js.map +1 -0
  76. package/dist/tailwind-plugin-theme.ts +5 -15
  77. package/dist/tailwind.config.d.ts +693 -0
  78. package/dist/tailwind.config.d.ts.map +1 -0
  79. package/dist/tailwind.config.js +6 -5
  80. package/dist/tailwind.config.js.map +1 -0
  81. package/dist/tailwind.config.ts +22 -14
  82. package/dist/util/string.d.ts +3 -0
  83. package/dist/util/string.d.ts.map +1 -0
  84. package/dist/util/string.js +2 -1
  85. package/dist/util/string.js.map +1 -0
  86. package/dist/util/svg.d.ts +3 -0
  87. package/dist/util/svg.d.ts.map +1 -0
  88. package/dist/util/svg.js +1 -0
  89. package/dist/util/svg.js.map +1 -0
  90. package/dist/utils/EventEmitterMixin.d.ts +62 -0
  91. package/dist/utils/EventEmitterMixin.d.ts.map +1 -0
  92. package/dist/utils/EventEmitterMixin.js +74 -0
  93. package/dist/utils/EventEmitterMixin.js.map +1 -0
  94. package/package.json +39 -17
  95. package/dist/storybook/assets/Color-AVL7NMMY-B58ga_hP.js +0 -1
  96. package/dist/storybook/assets/Colors.stories-BiV2pS3d.js +0 -79
  97. package/dist/storybook/assets/DocsRenderer-PQXLIZUC-DUVRw1oS.js +0 -1286
  98. package/dist/storybook/assets/Loader.stories-u1BnpDyi.js +0 -7
  99. package/dist/storybook/assets/iframe-BOWLMAWm.css +0 -1
  100. package/dist/storybook/assets/iframe-DT_nhsJu.js +0 -1057
  101. package/dist/storybook/assets/index-BTdkSEv_.js +0 -1
  102. package/dist/storybook/sb-manager/globals-module-info.js +0 -797
package/README.md CHANGED
@@ -1,6 +1,7 @@
1
- Brightspot UI
2
- =======
1
+ # Brightspot UI
2
+
3
3
  <a id="readme-top"></a>
4
+
4
5
  <div>
5
6
  <h2 align="center">brightspot-ui</h2>
6
7
  <p align="center">
@@ -52,7 +53,8 @@ _Note:_ To get the best developer experience we recommend using VSCode editor. T
52
53
  ### Prerequisites
53
54
 
54
55
  Your codebase needs to be compatible with
55
- * TailwindCSS **v3**
56
+
57
+ - TailwindCSS **v3**
56
58
 
57
59
  ### Installation
58
60
 
@@ -88,6 +90,7 @@ Brightspot UI comes with a variety of TailwindCSS plugins to make styling simple
88
90
  To use our plugins, include them in your TailwindCSS config as usual. Plugin files are provided in both Typescript and Javascript variants and are available under the `dist` path in the brightspot-ui module.
89
91
 
90
92
  An example of including all the plugins:
93
+
91
94
  ```ts
92
95
  // your tailwind.config.ts
93
96
  ...
@@ -101,41 +104,43 @@ An example of including all the plugins:
101
104
  require('@brightspot/ui/dist/tailwind-plugin-scroll-shadow.ts')
102
105
  ...
103
106
  ```
107
+
104
108
  ### Available plugins:
105
109
 
106
110
  1. Badge
107
- ```ts
108
- require('@brightspot/ui/dist/tailwind-plugin-badge.ts')
109
- ```
111
+ ```ts
112
+ require('@brightspot/ui/dist/tailwind-plugin-badge.ts')
113
+ ```
110
114
  2. Button
111
- ```ts
112
- require('@brightspot/ui/dist/tailwind-plugin-button.ts')
113
- ```
114
- 4. Heading
115
- ```ts
116
- require('@brightspot/ui/dist/tailwind-plugin-heading.ts')
117
- ```
118
- 5. Icon
119
- ```ts
120
- require('@brightspot/ui/dist/tailwind-plugin-icon.ts')
121
- ```
122
- 6. Loader
123
- ```ts
124
- require('@brightspot/ui/dist/tailwind-plugin-loader.ts')
125
- ```
126
- 7. ScrollShadow
127
- ```ts
128
- require('@brightspot/ui/dist/tailwind-plugin-scroll-shadow.ts')
129
- ```
130
- 8. Theme
131
- ```ts
115
+ ```ts
116
+ require('@brightspot/ui/dist/tailwind-plugin-button.ts')
117
+ ```
118
+ 3. Heading
119
+ ```ts
120
+ require('@brightspot/ui/dist/tailwind-plugin-heading.ts')
121
+ ```
122
+ 4. Icon
123
+ ```ts
124
+ require('@brightspot/ui/dist/tailwind-plugin-icon.ts')
125
+ ```
126
+ 5. Loader
127
+ ```ts
128
+ require('@brightspot/ui/dist/tailwind-plugin-loader.ts')
129
+ ```
130
+ 6. ScrollShadow
131
+ ```ts
132
+ require('@brightspot/ui/dist/tailwind-plugin-scroll-shadow.ts')
133
+ ```
134
+ 7. Theme
135
+ `ts
132
136
  require('@brightspot/ui/dist/tailwind-plugin-theme.ts')
133
- ```
137
+ `
134
138
  <p align="right">(<a href="#readme-top">back to top</a>)</p>
135
139
 
136
140
  ## Examples
137
141
 
138
142
  We use [Storybook](https://storybook.js.org/) for interactive previewing of our ui components. Launch that in the browser by running:
143
+
139
144
  ```sh
140
145
  yarn storybook
141
146
  ```
@@ -155,17 +160,23 @@ For local development and testing, use `yarn link` to create a symlink between t
155
160
  #### Setting up the link
156
161
 
157
162
  1. **In the brightspot-ui package directory:**
163
+
158
164
  ```sh
159
165
  yarn link
160
166
  ```
167
+
161
168
  This registers the package globally on your system for linking.
162
169
 
163
170
  2. **In your consuming project directory:**
171
+
164
172
  ```sh
165
173
  yarn link @brightspot/ui
166
174
  ```
175
+
167
176
  This creates a symlink from your project's node_modules to the brightspot-ui package.
168
177
 
178
+ > **_Note_** Be sure this is done in the directory where the `package.json` file resides for the CMS UI. Currently that is at `/cms/tool-ui`. You will need to validate your changes via your locally running Brightspot Tool UI Webpack server. It will not work directly over Docker's Tomcat.
179
+
169
180
  #### Working with the linked package
170
181
 
171
182
  - From within _**this**_ module, run `yarn build` to ensure the `dist` folder is updated with your changes.
@@ -176,6 +187,7 @@ For local development and testing, use `yarn link` to create a symlink between t
176
187
  When you're done with local development:
177
188
 
178
189
  1. **In your consuming project:**
190
+
179
191
  ```sh
180
192
  yarn unlink @brightspot/ui
181
193
  yarn install --force
@@ -188,38 +200,54 @@ When you're done with local development:
188
200
 
189
201
  This restores your project to use the published version from npm.
190
202
 
191
- ### Publishing
203
+ ### Commit Guidelines
192
204
 
193
- #### Prerelease (Testing)
205
+ This project uses [Conventional Commits](https://www.conventionalcommits.org/) to ensure consistent commit messages. All commits are automatically validated using [commitlint](https://commitlint.js.org/) via [husky](https://typicode.github.io/husky/) git hooks. When you attempt to commit, the commit message will be checked against conventional commit standards, and the commit will be rejected if it doesn't conform.
194
206
 
195
- For testing changes before a full release, create a prerelease version:
207
+ #### Using the `/git:commit` Command
208
+
209
+ For contributors using Claude Code, use the custom `/git:commit` slash command to create properly formatted commits:
196
210
 
197
211
  ```sh
198
- yarn version --prerelease
199
- npm publish --tag beta
212
+ /git:commit
200
213
  ```
201
214
 
202
- This automatically increments the version with a prerelease identifier (e.g., `1.2.3-0`) and publishes it under the `beta` tag. Users can install prereleases with:
215
+ This command automatically:
203
216
 
204
- ```sh
205
- yarn add @brightspot/ui@beta
206
- ```
217
+ - Analyzes your staged changes
218
+ - Generates a conventional commit message
219
+ - Creates the commit with proper formatting
207
220
 
208
- #### Full Release
221
+ #### Manual Commits
209
222
 
210
- For a production release:
223
+ If committing manually, follow this format:
211
224
 
212
- ```sh
213
- yarn version --patch # for bug fixes
214
- # or
215
- yarn version --minor # for new features
216
- # or
217
- yarn version --major # for breaking changes
225
+ ```
226
+ type(scope): subject
218
227
 
219
- npm publish
228
+ body (optional)
229
+
230
+ footer (optional)
220
231
  ```
221
232
 
222
- The `yarn version` command automatically updates the version number in package.json and creates a git commit and tag. Choose the appropriate version bump based on the type of changes you're releasing.
233
+ **Common types:**
234
+
235
+ - `feat`: New feature
236
+ - `fix`: Bug fix
237
+ - `docs`: Documentation changes
238
+ - `style`: Code style (formatting, whitespace)
239
+ - `refactor`: Code restructuring
240
+ - `test`: Adding or updating tests
241
+ - `chore`: Maintenance tasks (deps, build tools)
242
+
243
+ **Examples:**
244
+
245
+ ```
246
+ feat(button): add icon support to primary button
247
+ fix(theme): resolve color contrast in dark mode
248
+ docs: update installation instructions
249
+ chore(deps): upgrade tailwindcss to 3.4.0
250
+ ```
223
251
 
224
252
  <p align="right">(<a href="#readme-top">back to top</a>)</p>
225
253
 
@@ -0,0 +1,214 @@
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"
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
+ }
@@ -0,0 +1,5 @@
1
+ export declare function getIcon(iconName: string): {
2
+ compat: string;
3
+ iconSvg: string;
4
+ } | undefined;
5
+ //# sourceMappingURL=LucideDynamicLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LucideDynamicLoader.d.ts","sourceRoot":"","sources":["../src/LucideDynamicLoader.ts"],"names":[],"mappings":"AAKA,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM;;;cAiBvC"}
@@ -1,5 +1,5 @@
1
1
  import * as LucideIcons from 'lucide-static';
2
- import icons from 'lucide-static/font/info.json';
2
+ import icons from 'lucide-static/font/info.json' with { type: 'json' };
3
3
  import { kebabToPascal } from '../src/util/string';
4
4
  import { addNameSpaceXML, encodeSVG } from '../src/util/svg';
5
5
  export function getIcon(iconName) {
@@ -19,3 +19,4 @@ export function getIcon(iconName) {
19
19
  console.error('Error loading Lucide icon ${iconName}:', e);
20
20
  }
21
21
  }
22
+ //# sourceMappingURL=LucideDynamicLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LucideDynamicLoader.js","sourceRoot":"","sources":["../src/LucideDynamicLoader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,MAAM,8BAA8B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE5D,MAAM,UAAU,OAAO,CAAC,QAAgB;IACtC,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAA;QAC5E,MAAM,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC,CAAA;QAE3C,IAAI,WAAW,CAAC,UAAsC,CAAC,EAAE,CAAC;YACxD,MAAM,GAAG,GAAG,WAAW,CAAC,UAAsC,CAAW,CAAA;YACzE,MAAM,UAAU,GAAG,SAAS,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAA;YAElD,OAAO;gBACL,MAAM,EAAE,KAAK,CAAC,SAA+B,CAAC,EAAE,WAAW,IAAI,EAAE;gBACjE,OAAO,EAAE,UAAU;aACpB,CAAA;QACH,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,wCAAwC,EAAE,CAAC,CAAC,CAAA;IAC5D,CAAC;AACH,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import * as LucideIcons from 'lucide-static'
2
- import icons from 'lucide-static/font/info.json'
2
+ import icons from 'lucide-static/font/info.json' with { type: 'json' }
3
3
  import { kebabToPascal } from '../src/util/string'
4
4
  import { addNameSpaceXML, encodeSVG } from '../src/util/svg'
5
5
 
@@ -0,0 +1,118 @@
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 ... */
@@ -0,0 +1,90 @@
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").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
@@ -0,0 +1 @@
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;AAEH,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;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,MAAM,CAAA;KACrB;CACF"}