@brightspot/ui 1.0.1-4 → 1.0.1-wc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -33
- package/custom-elements.json +214 -0
- package/dist/LucideDynamicLoader.d.ts +5 -0
- package/dist/LucideDynamicLoader.d.ts.map +1 -0
- package/dist/LucideDynamicLoader.js +2 -1
- package/dist/LucideDynamicLoader.js.map +1 -0
- package/dist/LucideDynamicLoader.ts +1 -1
- package/dist/components/widget/Widget.css +118 -0
- package/dist/components/widget/Widget.d.ts +90 -0
- package/dist/components/widget/Widget.d.ts.map +1 -0
- package/dist/components/widget/Widget.js +195 -0
- package/dist/components/widget/Widget.js.map +1 -0
- package/dist/components/widget/WidgetUtils.d.ts +14 -0
- package/dist/components/widget/WidgetUtils.d.ts.map +1 -0
- package/dist/components/widget/WidgetUtils.js +42 -0
- package/dist/components/widget/WidgetUtils.js.map +1 -0
- package/dist/global.d.ts +14 -0
- package/dist/storybook/assets/{Badge.stories-BTUP8EEA.js → Badge.stories-BVaCGD8W.js} +3 -7
- package/dist/storybook/assets/{Button.stories-Cr7Qwtjy.js → Button.stories-C0BmUO4_.js} +1 -1
- package/dist/storybook/assets/Color-64QXVMR3-zezFbyuS.js +1 -0
- package/dist/storybook/assets/{Colors.stories-DTkJ49c0.js → Colors.stories-CYFhcW5P.js} +2 -2
- package/dist/storybook/assets/{Heading.stories-DAeD9lW6.js → Heading.stories-8LPqm3WW.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-cnRmIS9M.js → Icon.stories-CpupdzrH.js} +1592 -9552
- package/dist/storybook/assets/Loader.stories-D0mnY_Z0.js +3 -0
- package/dist/storybook/assets/{ScrollShadow.stories-DPlCRYP5.js → ScrollShadow.stories-BB4wF3c9.js} +1 -1
- package/dist/storybook/assets/Widget-CRTwFkFc.css +1 -0
- package/dist/storybook/assets/Widget.stories-yw3AloF5.js +323 -0
- package/dist/storybook/assets/WithTooltip-SK46ZJ2J-bOrMS36j.js +825 -0
- package/dist/storybook/assets/formatter-OMEEQ6HG-D2EXmNwo.js +1 -0
- package/dist/storybook/assets/iframe-BdHEYpHD.css +1 -0
- package/dist/storybook/assets/iframe-C5bTYo4K.js +1077 -0
- package/dist/storybook/assets/index-BLdw66Ec.js +1 -0
- package/dist/storybook/assets/syntaxhighlighter-CAVLW7PM-yrojVZDo.js +6 -0
- package/dist/storybook/iframe.html +4 -4
- package/dist/storybook/index.html +2 -13
- package/dist/storybook/index.json +1 -1
- package/dist/storybook/project.json +1 -1
- package/dist/storybook/sb-addons/docs-1/manager-bundle.js +1 -149
- package/dist/storybook/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +158 -323
- package/dist/storybook/sb-manager/globals-runtime.js +79814 -65954
- package/dist/storybook/sb-manager/globals.js +7 -16
- package/dist/storybook/sb-manager/runtime.js +15451 -9508
- package/dist/storybook/vite-inject-mocker-entry.js +1 -17
- package/dist/tailwind-plugin-badge.d.ts +2 -0
- package/dist/tailwind-plugin-badge.d.ts.map +1 -0
- package/dist/tailwind-plugin-badge.js +4 -3
- package/dist/tailwind-plugin-badge.js.map +1 -0
- package/dist/tailwind-plugin-badge.ts +4 -4
- package/dist/tailwind-plugin-button.d.ts +2 -0
- package/dist/tailwind-plugin-button.d.ts.map +1 -0
- package/dist/tailwind-plugin-button.js +2 -5
- package/dist/tailwind-plugin-button.js.map +1 -0
- package/dist/tailwind-plugin-button.ts +8 -21
- package/dist/tailwind-plugin-heading.d.ts +2 -0
- package/dist/tailwind-plugin-heading.d.ts.map +1 -0
- package/dist/tailwind-plugin-heading.js +1 -0
- package/dist/tailwind-plugin-heading.js.map +1 -0
- package/dist/tailwind-plugin-icon.d.ts +2 -0
- package/dist/tailwind-plugin-icon.d.ts.map +1 -0
- package/dist/tailwind-plugin-icon.js +6 -5
- package/dist/tailwind-plugin-icon.js.map +1 -0
- package/dist/tailwind-plugin-icon.ts +14 -23
- package/dist/tailwind-plugin-loader.d.ts +2 -0
- package/dist/tailwind-plugin-loader.d.ts.map +1 -0
- package/dist/tailwind-plugin-loader.js +1 -0
- package/dist/tailwind-plugin-loader.js.map +1 -0
- package/dist/tailwind-plugin-scroll-shadow.d.ts +2 -0
- package/dist/tailwind-plugin-scroll-shadow.d.ts.map +1 -0
- package/dist/tailwind-plugin-scroll-shadow.js +16 -1
- package/dist/tailwind-plugin-scroll-shadow.js.map +1 -0
- package/dist/tailwind-plugin-scroll-shadow.ts +33 -22
- package/dist/tailwind-plugin-theme.d.ts +2 -0
- package/dist/tailwind-plugin-theme.d.ts.map +1 -0
- package/dist/tailwind-plugin-theme.js +2 -3
- package/dist/tailwind-plugin-theme.js.map +1 -0
- package/dist/tailwind-plugin-theme.ts +4 -15
- package/dist/tailwind.config.d.ts +693 -0
- package/dist/tailwind.config.d.ts.map +1 -0
- package/dist/tailwind.config.js +2 -4
- package/dist/tailwind.config.js.map +1 -0
- package/dist/tailwind.config.ts +2 -6
- package/dist/util/string.d.ts +3 -0
- package/dist/util/string.d.ts.map +1 -0
- package/dist/util/string.js +2 -1
- package/dist/util/string.js.map +1 -0
- package/dist/util/svg.d.ts +3 -0
- package/dist/util/svg.d.ts.map +1 -0
- package/dist/util/svg.js +1 -0
- package/dist/util/svg.js.map +1 -0
- package/dist/utils/EventEmitterMixin.d.ts +62 -0
- package/dist/utils/EventEmitterMixin.d.ts.map +1 -0
- package/dist/utils/EventEmitterMixin.js +74 -0
- package/dist/utils/EventEmitterMixin.js.map +1 -0
- package/package.json +43 -18
- package/dist/storybook/assets/Color-AVL7NMMY-FwGGzq-S.js +0 -1
- package/dist/storybook/assets/DocsRenderer-PQXLIZUC-czZuJbjz.js +0 -1286
- package/dist/storybook/assets/Loader.stories-i7TFXki_.js +0 -7
- package/dist/storybook/assets/iframe-CgQYHqh5.css +0 -1
- package/dist/storybook/assets/iframe-KLSeZXhG.js +0 -1059
- package/dist/storybook/assets/index-Du6pvkZG.js +0 -1
- package/dist/storybook/sb-manager/globals-module-info.js +0 -797
package/README.md
CHANGED
|
@@ -168,11 +168,15 @@ For local development and testing, use `yarn link` to create a symlink between t
|
|
|
168
168
|
This registers the package globally on your system for linking.
|
|
169
169
|
|
|
170
170
|
2. **In your consuming project directory:**
|
|
171
|
+
|
|
171
172
|
```sh
|
|
172
173
|
yarn link @brightspot/ui
|
|
173
174
|
```
|
|
175
|
+
|
|
174
176
|
This creates a symlink from your project's node_modules to the brightspot-ui package.
|
|
175
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
|
+
|
|
176
180
|
#### Working with the linked package
|
|
177
181
|
|
|
178
182
|
- From within _**this**_ module, run `yarn build` to ensure the `dist` folder is updated with your changes.
|
|
@@ -245,39 +249,6 @@ docs: update installation instructions
|
|
|
245
249
|
chore(deps): upgrade tailwindcss to 3.4.0
|
|
246
250
|
```
|
|
247
251
|
|
|
248
|
-
### Publishing
|
|
249
|
-
|
|
250
|
-
#### Prerelease (Testing)
|
|
251
|
-
|
|
252
|
-
For testing changes before a full release, create a prerelease version:
|
|
253
|
-
|
|
254
|
-
```sh
|
|
255
|
-
yarn version --prerelease
|
|
256
|
-
npm publish --tag beta
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
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:
|
|
260
|
-
|
|
261
|
-
```sh
|
|
262
|
-
yarn add @brightspot/ui@beta
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
#### Full Release
|
|
266
|
-
|
|
267
|
-
For a production release:
|
|
268
|
-
|
|
269
|
-
```sh
|
|
270
|
-
yarn version --patch # for bug fixes
|
|
271
|
-
# or
|
|
272
|
-
yarn version --minor # for new features
|
|
273
|
-
# or
|
|
274
|
-
yarn version --major # for breaking changes
|
|
275
|
-
|
|
276
|
-
npm publish
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
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.
|
|
280
|
-
|
|
281
252
|
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
|
282
253
|
|
|
283
254
|
## Frequently Asked Questions
|
|
@@ -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 @@
|
|
|
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"}
|