@brightspot/ui 1.0.0-alpha.2 → 1.0.0-alpha.4

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 (48) hide show
  1. package/dist/LucideDynamicLoader.js +21 -0
  2. package/dist/LucideDynamicLoader.ts +23 -0
  3. package/dist/storybook/342.9186a774.iframe.bundle.js +2 -0
  4. package/dist/storybook/342.9186a774.iframe.bundle.js.LICENSE.txt +6 -0
  5. package/dist/storybook/{648.0f0c2ea1.iframe.bundle.js → 648.0f339b09.iframe.bundle.js} +1 -1
  6. package/dist/storybook/689.bf58321f.iframe.bundle.js +95 -0
  7. package/dist/storybook/689.bf58321f.iframe.bundle.js.map +1 -0
  8. package/dist/storybook/906.0b06b831.iframe.bundle.js +405 -0
  9. package/dist/storybook/{906.c7ad56cf.iframe.bundle.js.map → 906.0b06b831.iframe.bundle.js.map} +1 -1
  10. package/dist/storybook/936.9ad0e832.iframe.bundle.js +1 -0
  11. package/dist/storybook/iframe.html +3 -3
  12. package/dist/storybook/index.json +1 -1
  13. package/dist/storybook/main.60eb2a33.iframe.bundle.js +1 -0
  14. package/dist/storybook/project.json +1 -1
  15. package/dist/storybook/runtime~main.0d0d1d44.iframe.bundle.js +1 -0
  16. package/dist/storybook/sb-addons/essentials-backgrounds-4/manager-bundle.js +1 -1
  17. package/dist/storybook/sb-addons/essentials-controls-1/manager-bundle.js +8 -8
  18. package/dist/storybook/sb-addons/essentials-docs-3/manager-bundle.js +4 -4
  19. package/dist/storybook/sb-addons/essentials-measure-7/manager-bundle.js +1 -1
  20. package/dist/storybook/sb-addons/essentials-outline-8/manager-bundle.js +1 -1
  21. package/dist/storybook/sb-addons/essentials-viewport-5/manager-bundle.js +1 -1
  22. package/dist/storybook/sb-manager/globals-module-info.js +1 -0
  23. package/dist/storybook/sb-manager/globals-runtime.js +10372 -9836
  24. package/dist/storybook/sb-manager/runtime.js +119 -119
  25. package/dist/storybook/stories-Badge-stories.52b61cf3.iframe.bundle.js.map +1 -1
  26. package/dist/storybook/stories-Button-stories.777d0529.iframe.bundle.js.map +1 -1
  27. package/dist/storybook/{stories-Colors-stories.324d20d0.iframe.bundle.js → stories-Colors-stories.927fecc8.iframe.bundle.js} +2 -2
  28. package/dist/storybook/{stories-Colors-stories.324d20d0.iframe.bundle.js.map → stories-Colors-stories.927fecc8.iframe.bundle.js.map} +1 -1
  29. package/dist/storybook/stories-Icon-stories.f2eb249f.iframe.bundle.js +8 -0
  30. package/dist/storybook/stories-Icon-stories.f2eb249f.iframe.bundle.js.map +1 -0
  31. package/dist/storybook/{stories-ScrollShadow-stories.252ec9e7.iframe.bundle.js → stories-ScrollShadow-stories.ddf1e99b.iframe.bundle.js} +4 -4
  32. package/dist/storybook/stories-ScrollShadow-stories.ddf1e99b.iframe.bundle.js.map +1 -0
  33. package/dist/tailwind-plugin-icon.js +4 -133
  34. package/dist/tailwind-plugin-icon.ts +4 -147
  35. package/dist/tailwind.config.js +6 -1
  36. package/dist/tailwind.config.ts +6 -1
  37. package/dist/util/string.js +14 -0
  38. package/dist/util/svg.js +13 -0
  39. package/package.json +1 -1
  40. package/dist/storybook/689.b6901a43.iframe.bundle.js +0 -95
  41. package/dist/storybook/689.b6901a43.iframe.bundle.js.map +0 -1
  42. package/dist/storybook/906.c7ad56cf.iframe.bundle.js +0 -405
  43. package/dist/storybook/936.7e4d4897.iframe.bundle.js +0 -1
  44. package/dist/storybook/main.7b0cb99d.iframe.bundle.js +0 -1
  45. package/dist/storybook/runtime~main.a1926d89.iframe.bundle.js +0 -1
  46. package/dist/storybook/stories-ScrollShadow-stories.252ec9e7.iframe.bundle.js.map +0 -1
  47. /package/dist/storybook/{689.b6901a43.iframe.bundle.js.LICENSE.txt → 689.bf58321f.iframe.bundle.js.LICENSE.txt} +0 -0
  48. /package/dist/storybook/{906.c7ad56cf.iframe.bundle.js.LICENSE.txt → 906.0b06b831.iframe.bundle.js.LICENSE.txt} +0 -0
@@ -1,6 +1,8 @@
1
1
  import plugin from 'tailwindcss/plugin';
2
2
  import icons from 'lucide-static/font/info.json';
3
3
  import * as LucideExports from 'lucide-static/dist/cjs/lucide-static';
4
+ import { pascalToKebab } from './util/string';
5
+ import { addNameSpaceXML, encodeSVG } from './util/svg';
4
6
  /**
5
7
  * Lucide Icons | https://lucide.dev/icons/
6
8
  * Each icon is designed on a 24x24 grid with an emphasis on simplicity, consistency and readability.
@@ -39,31 +41,7 @@ for (const [key, value] of Object.entries(LucideExports)) {
39
41
  }
40
42
  }
41
43
  }
42
- function addNameSpace(data) {
43
- if (data.indexOf(`http://www.w3.org/2000/svg`) < 0) {
44
- data = data.replace(/<svg/g, `<svg xmlns='http://www.w3.org/2000/svg'`);
45
- }
46
- return data;
47
- }
48
- function pascalToKebab(str) {
49
- return str
50
- .replace(/([a-z0-9])([A-Z])/g, '$1-$2')
51
- .replace(/([A-Za-z])([0-9])/g, '$1-$2')
52
- .toLowerCase();
53
- }
54
- function kebabToPascal(str) {
55
- return str
56
- .split('-')
57
- .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
58
- .join('');
59
- }
60
- function encodeSVG(data) {
61
- data = data.replace(/"/g, `'`);
62
- data = data.replace(/>\s{1,}</g, `><`);
63
- data = data.replace(/\s{2,}/g, ` `);
64
- return data.replace(symbols, encodeURIComponent);
65
- }
66
- module.exports = plugin(function ({ addBase, addComponents, matchUtilities, theme }) {
44
+ module.exports = plugin(function ({ addComponents, matchUtilities, theme }) {
67
45
  const size = 'var(--Icon-size)';
68
46
  const prefix = '.btu-icon-';
69
47
  Object.entries(svgs).forEach(([key, svg]) => {
@@ -76,7 +54,7 @@ module.exports = plugin(function ({ addBase, addComponents, matchUtilities, them
76
54
  },
77
55
  [`${prefix}via-mask-${pascalToKebab(key)}`]: {
78
56
  '--size': '20px',
79
- '--Icon-svg': `url("data:image/svg+xml,${encodeSVG(addNameSpace(svg))}")`,
57
+ '--Icon-svg': `url("data:image/svg+xml,${encodeSVG(addNameSpaceXML(svg))}")`,
80
58
  mask: 'var(--Icon-svg) center / contain no-repeat',
81
59
  'aspect-ratio': '1',
82
60
  'inline-size': 'var(--Icon-size, --size)',
@@ -126,113 +104,6 @@ module.exports = plugin(function ({ addBase, addComponents, matchUtilities, them
126
104
  '--Icon-size': value,
127
105
  }),
128
106
  }, { values: theme('iconSize') });
129
- // Compat v4 Icons:
130
- // Icon names which are Google Material icons mapped to a lucide equivalent to support the legacy markup.
131
- const compatNames = new Map();
132
- compatNames.set('arrow_downward', 'arrow-down');
133
- compatNames.set('arrow_upward', 'arrow-up');
134
- compatNames.set('assessment', 'file-chart-pie');
135
- compatNames.set('assignment', 'clipboard-check');
136
- compatNames.set('attachment', 'file');
137
- compatNames.set('auto_stories', 'book');
138
- compatNames.set('ballot', 'shield-question');
139
- compatNames.set('border_all', 'table-2');
140
- compatNames.set('cancel', 'circle-x');
141
- compatNames.set('chat_bubble', 'message-circle');
142
- compatNames.set('check_circle', 'circle-check-big');
143
- compatNames.set('chrome_reader_mode', 'table-properties');
144
- compatNames.set('class', 'book-type');
145
- compatNames.set('close', 'x');
146
- compatNames.set('code', 'code');
147
- compatNames.set('comment', 'message-circle-plus');
148
- compatNames.set('comments_disabled', 'message-circle-x');
149
- compatNames.set('create_new_folder', 'boxes');
150
- compatNames.set('description', 'file-text');
151
- compatNames.set('edit', 'pencil');
152
- compatNames.set('error', 'circle-alert');
153
- compatNames.set('expand_more', 'chevrons-up-down');
154
- compatNames.set('expand_less', 'chevrons-down-up');
155
- compatNames.set('feed', 'scroll-text');
156
- compatNames.set('format_align_center', 'align-center');
157
- compatNames.set('format_align_left', 'align-left');
158
- compatNames.set('format_align_right', 'align-right');
159
- compatNames.set('format_bold', 'bold');
160
- compatNames.set('format_clear', 'remove-formatting');
161
- compatNames.set('format_indent_increase', 'indent-increase');
162
- compatNames.set('format_indent_decrease', 'indent-decrease');
163
- compatNames.set('format_italic', 'italic');
164
- compatNames.set('format_list_bulleted', 'list');
165
- compatNames.set('format_list_numbered', 'badge-help');
166
- compatNames.set('format_quote', 'quote');
167
- compatNames.set('format_strikethrough', 'strikethrough');
168
- compatNames.set('format_underlined', 'underline');
169
- compatNames.set('fullscreen', 'maximize-2');
170
- compatNames.set('grid_on', 'file-spreadsheet');
171
- compatNames.set('handshake', 'handshake');
172
- compatNames.set('help', 'circle-help');
173
- compatNames.set('history', 'history');
174
- compatNames.set('home', 'house');
175
- compatNames.set('import_contacts', 'book');
176
- compatNames.set('insert_photo', 'file-image');
177
- compatNames.set('keyboard', 'keyboard');
178
- compatNames.set('link', 'link-2');
179
- compatNames.set('link_off', 'link-2-off');
180
- compatNames.set('live_tv', 'tv-minimal-play');
181
- compatNames.set('local_offer', 'tag');
182
- compatNames.set('manage_search', 'text-search');
183
- compatNames.set('menu_book', 'book-marked');
184
- compatNames.set('more_horiz', 'ellipsis');
185
- compatNames.set('music_note', 'music-2');
186
- compatNames.set('notes', 'notebook-text');
187
- compatNames.set('ondemand_video', 'video');
188
- compatNames.set('open_with', 'move');
189
- compatNames.set('person', 'user-pen');
190
- compatNames.set('photo', 'file-image');
191
- compatNames.set('photo_camera', 'camera');
192
- compatNames.set('photo_library', 'images');
193
- compatNames.set('picture', 'image-up');
194
- compatNames.set('play', 'square-play');
195
- compatNames.set('playlist_play', 'list-video');
196
- compatNames.set('post_add', 'clipboard-plus');
197
- compatNames.set('question_answer', 'pencil-line');
198
- compatNames.set('rate_review', 'square-pen');
199
- compatNames.set('redo', 'redo');
200
- compatNames.set('remove', 'minus');
201
- compatNames.set('school', 'badge-info');
202
- compatNames.set('search', 'search');
203
- compatNames.set('settings_ethernet', 'chevrons-left-right-ellipsis');
204
- compatNames.set('short_text', 'text');
205
- compatNames.set('slideshow', 'film');
206
- compatNames.set('slow_motion_video', 'list-video');
207
- compatNames.set('subject', 'letter-text');
208
- compatNames.set('textsms', 'message-circle-more');
209
- compatNames.set('theaters', 'clapperboard');
210
- compatNames.set('toc', 'notebook-tabs');
211
- compatNames.set('toggle_off', 'toggle-left');
212
- compatNames.set('toggle_on', 'toggle-right');
213
- compatNames.set('undo', 'undo');
214
- compatNames.set('vertical_align_bottom', 'subscript');
215
- compatNames.set('vertical_align_top', 'superscript');
216
- compatNames.set('view_compact', 'layout-panel-top');
217
- compatNames.set('volume_up', 'volume-2');
218
- compatNames.set('warning', 'triangle-alert');
219
- compatNames.set('wb_incandescent', 'lightbulb');
220
- compatNames.set('widgets', 'blocks');
221
- compatNames.set('zap', 'zap');
222
- compatNames.forEach((value, key) => {
223
- addBase({
224
- /* this is the default icon when no mapped icon is found */
225
- [`[data-icon],[data-icon-name],[data-icon-button-name]`]: {
226
- '--compat-icon': `'${icons['circle-dashed'].encodedCode}'`,
227
- '--compat-icon-via-mask': `url("data:image/svg+xml,${encodeSVG(addNameSpace(svgs['CircleDashed']))}")`,
228
- },
229
- [`html [data-icon="${key}"],html [data-icon-name="${key}"],html [data-icon-button-name="${key}"]`]: {
230
- // tslint:disable-next-line
231
- '--compat-icon': `'${icons[value].encodedCode}'`,
232
- '--compat-icon-via-mask': `url("data:image/svg+xml,${encodeSVG(addNameSpace(svgs[kebabToPascal(value)]))}")`,
233
- },
234
- });
235
- });
236
107
  }, {
237
108
  theme: {
238
109
  iconSize: {
@@ -1,15 +1,10 @@
1
1
  import plugin from 'tailwindcss/plugin'
2
2
  import icons from 'lucide-static/font/info.json'
3
3
  import * as LucideExports from 'lucide-static/dist/cjs/lucide-static'
4
+ import { pascalToKebab } from './util/string'
5
+ import { addNameSpaceXML, encodeSVG } from './util/svg'
4
6
  declare let module: any
5
7
 
6
- interface LucideTypes {
7
- encodedCode: string
8
- prefix: string
9
- className: string
10
- unicode: string
11
- }
12
-
13
8
  /**
14
9
  * Lucide Icons | https://lucide.dev/icons/
15
10
  * Each icon is designed on a 24x24 grid with an emphasis on simplicity, consistency and readability.
@@ -50,36 +45,8 @@ for (const [key, value] of Object.entries(LucideExports)) {
50
45
  }
51
46
  }
52
47
 
53
- function addNameSpace(data: string): string {
54
- if (data.indexOf(`http://www.w3.org/2000/svg`) < 0) {
55
- data = data.replace(/<svg/g, `<svg xmlns='http://www.w3.org/2000/svg'`)
56
- }
57
- return data
58
- }
59
-
60
- function pascalToKebab(str: string): string {
61
- return str
62
- .replace(/([a-z0-9])([A-Z])/g, '$1-$2')
63
- .replace(/([A-Za-z])([0-9])/g, '$1-$2')
64
- .toLowerCase()
65
- }
66
-
67
- function kebabToPascal(str: string): string {
68
- return str
69
- .split('-')
70
- .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
71
- .join('')
72
- }
73
-
74
- function encodeSVG(data: string): string {
75
- data = data.replace(/"/g, `'`)
76
- data = data.replace(/>\s{1,}</g, `><`)
77
- data = data.replace(/\s{2,}/g, ` `)
78
- return data.replace(symbols, encodeURIComponent)
79
- }
80
-
81
48
  module.exports = plugin(
82
- function ({ addBase, addComponents, matchUtilities, theme }) {
49
+ function ({ addComponents, matchUtilities, theme }) {
83
50
  const size = 'var(--Icon-size)'
84
51
  const prefix = '.btu-icon-'
85
52
 
@@ -93,7 +60,7 @@ module.exports = plugin(
93
60
  },
94
61
  [`${prefix}via-mask-${pascalToKebab(key)}`]: {
95
62
  '--size': '20px',
96
- '--Icon-svg': `url("data:image/svg+xml,${encodeSVG(addNameSpace(svg))}")`,
63
+ '--Icon-svg': `url("data:image/svg+xml,${encodeSVG(addNameSpaceXML(svg))}")`,
97
64
  mask: 'var(--Icon-svg) center / contain no-repeat',
98
65
  'aspect-ratio': '1',
99
66
  'inline-size': 'var(--Icon-size, --size)',
@@ -154,116 +121,6 @@ module.exports = plugin(
154
121
  },
155
122
  { values: theme('iconSize') },
156
123
  )
157
-
158
- // Compat v4 Icons:
159
- // Icon names which are Google Material icons mapped to a lucide equivalent to support the legacy markup.
160
- const compatNames = new Map()
161
- compatNames.set('arrow_downward', 'arrow-down')
162
- compatNames.set('arrow_upward', 'arrow-up')
163
- compatNames.set('assessment', 'file-chart-pie')
164
- compatNames.set('assignment', 'clipboard-check')
165
- compatNames.set('attachment', 'file')
166
- compatNames.set('auto_stories', 'book')
167
- compatNames.set('ballot', 'shield-question')
168
- compatNames.set('border_all', 'table-2')
169
- compatNames.set('cancel', 'circle-x')
170
- compatNames.set('chat_bubble', 'message-circle')
171
- compatNames.set('check_circle', 'circle-check-big')
172
- compatNames.set('chrome_reader_mode', 'table-properties')
173
- compatNames.set('class', 'book-type')
174
- compatNames.set('close', 'x')
175
- compatNames.set('code', 'code')
176
- compatNames.set('comment', 'message-circle-plus')
177
- compatNames.set('comments_disabled', 'message-circle-x')
178
- compatNames.set('create_new_folder', 'boxes')
179
- compatNames.set('description', 'file-text')
180
- compatNames.set('edit', 'pencil')
181
- compatNames.set('error', 'circle-alert')
182
- compatNames.set('expand_more', 'chevrons-up-down')
183
- compatNames.set('expand_less', 'chevrons-down-up')
184
- compatNames.set('feed', 'scroll-text')
185
- compatNames.set('format_align_center', 'align-center')
186
- compatNames.set('format_align_left', 'align-left')
187
- compatNames.set('format_align_right', 'align-right')
188
- compatNames.set('format_bold', 'bold')
189
- compatNames.set('format_clear', 'remove-formatting')
190
- compatNames.set('format_indent_increase', 'indent-increase')
191
- compatNames.set('format_indent_decrease', 'indent-decrease')
192
- compatNames.set('format_italic', 'italic')
193
- compatNames.set('format_list_bulleted', 'list')
194
- compatNames.set('format_list_numbered', 'badge-help')
195
- compatNames.set('format_quote', 'quote')
196
- compatNames.set('format_strikethrough', 'strikethrough')
197
- compatNames.set('format_underlined', 'underline')
198
- compatNames.set('fullscreen', 'maximize-2')
199
- compatNames.set('grid_on', 'file-spreadsheet')
200
- compatNames.set('handshake', 'handshake')
201
- compatNames.set('help', 'circle-help')
202
- compatNames.set('history', 'history')
203
- compatNames.set('home', 'house')
204
- compatNames.set('import_contacts', 'book')
205
- compatNames.set('insert_photo', 'file-image')
206
- compatNames.set('keyboard', 'keyboard')
207
- compatNames.set('link', 'link-2')
208
- compatNames.set('link_off', 'link-2-off')
209
- compatNames.set('live_tv', 'tv-minimal-play')
210
- compatNames.set('local_offer', 'tag')
211
- compatNames.set('manage_search', 'text-search')
212
- compatNames.set('menu_book', 'book-marked')
213
- compatNames.set('more_horiz', 'ellipsis')
214
- compatNames.set('music_note', 'music-2')
215
- compatNames.set('notes', 'notebook-text')
216
- compatNames.set('ondemand_video', 'video')
217
- compatNames.set('open_with', 'move')
218
- compatNames.set('person', 'user-pen')
219
- compatNames.set('photo', 'file-image')
220
- compatNames.set('photo_camera', 'camera')
221
- compatNames.set('photo_library', 'images')
222
- compatNames.set('picture', 'image-up')
223
- compatNames.set('play', 'square-play')
224
- compatNames.set('playlist_play', 'list-video')
225
- compatNames.set('post_add', 'clipboard-plus')
226
- compatNames.set('question_answer', 'pencil-line')
227
- compatNames.set('rate_review', 'square-pen')
228
- compatNames.set('redo', 'redo')
229
- compatNames.set('remove', 'minus')
230
- compatNames.set('school', 'badge-info')
231
- compatNames.set('search', 'search')
232
- compatNames.set('settings_ethernet', 'chevrons-left-right-ellipsis')
233
- compatNames.set('short_text', 'text')
234
- compatNames.set('slideshow', 'film')
235
- compatNames.set('slow_motion_video', 'list-video')
236
- compatNames.set('subject', 'letter-text')
237
- compatNames.set('textsms', 'message-circle-more')
238
- compatNames.set('theaters', 'clapperboard')
239
- compatNames.set('toc', 'notebook-tabs')
240
- compatNames.set('toggle_off', 'toggle-left')
241
- compatNames.set('toggle_on', 'toggle-right')
242
- compatNames.set('undo', 'undo')
243
- compatNames.set('vertical_align_bottom', 'subscript')
244
- compatNames.set('vertical_align_top', 'superscript')
245
- compatNames.set('view_compact', 'layout-panel-top')
246
- compatNames.set('volume_up', 'volume-2')
247
- compatNames.set('warning', 'triangle-alert')
248
- compatNames.set('wb_incandescent', 'lightbulb')
249
- compatNames.set('widgets', 'blocks')
250
- compatNames.set('zap', 'zap')
251
-
252
- compatNames.forEach((value: string, key) => {
253
- addBase({
254
- /* this is the default icon when no mapped icon is found */
255
- [`[data-icon],[data-icon-name],[data-icon-button-name]`]: {
256
- '--compat-icon': `'${icons['circle-dashed'].encodedCode}'`,
257
- '--compat-icon-via-mask': `url("data:image/svg+xml,${encodeSVG(addNameSpace(svgs['CircleDashed']))}")`,
258
- },
259
- [`html [data-icon="${key}"],html [data-icon-name="${key}"],html [data-icon-button-name="${key}"]`]:
260
- {
261
- // tslint:disable-next-line
262
- '--compat-icon': `'${(icons as Record<string, LucideTypes>)[value].encodedCode}'`,
263
- '--compat-icon-via-mask': `url("data:image/svg+xml,${encodeSVG(addNameSpace(svgs[kebabToPascal(value)]))}")`,
264
- },
265
- })
266
- })
267
124
  },
268
125
  {
269
126
  theme: {
@@ -1,4 +1,5 @@
1
1
  import defaultTheme from 'tailwindcss/defaultTheme';
2
+ import plugin from 'tailwindcss/plugin';
2
3
  /* All tailwind configuration options can be found at: https://tailwindcss.com/docs/configuration */
3
4
  export default {
4
5
  /* extending the TWCSS dark variant since we also use a root-classname of "is-dark" to enable dark mode */
@@ -563,5 +564,9 @@ export default {
563
564
  starFilled: 'polygon(54.55% 9.09%,68.59% 37.55%,100% 42.14%,77.27% 64.27%,82.64% 95.55%,54.55% 80.77%,26.45% 95.55%,31.82% 64.27%,9.09% 42.14%,40.5% 37.55%,54.55% 9.09%)',
564
565
  },
565
566
  },
566
- plugins: [],
567
+ plugins: [
568
+ plugin(({ addVariant }) => {
569
+ addVariant('touch-device', '@media (hover: none) or (pointer: coarse)');
570
+ }),
571
+ ],
567
572
  };
@@ -1,5 +1,6 @@
1
1
  import type { Config } from 'tailwindcss'
2
2
  import defaultTheme from 'tailwindcss/defaultTheme'
3
+ import plugin from 'tailwindcss/plugin'
3
4
 
4
5
  /* All tailwind configuration options can be found at: https://tailwindcss.com/docs/configuration */
5
6
  export default {
@@ -578,5 +579,9 @@ export default {
578
579
  'polygon(54.55% 9.09%,68.59% 37.55%,100% 42.14%,77.27% 64.27%,82.64% 95.55%,54.55% 80.77%,26.45% 95.55%,31.82% 64.27%,9.09% 42.14%,40.5% 37.55%,54.55% 9.09%)',
579
580
  },
580
581
  },
581
- plugins: [],
582
+ plugins: [
583
+ plugin(({ addVariant }) => {
584
+ addVariant('touch-device', '@media (hover: none) or (pointer: coarse)')
585
+ }),
586
+ ],
582
587
  } satisfies Config
@@ -0,0 +1,14 @@
1
+ // Given "WaterBalloon", returns "water-balloon"
2
+ export function pascalToKebab(str) {
3
+ return str
4
+ .replace(/([a-z0-9])([A-Z])/g, '$1-$2')
5
+ .replace(/([A-Za-z])([0-9])/g, '$1-$2')
6
+ .toLowerCase();
7
+ }
8
+ // Given "water-balloon", returns "WaterBalloon"
9
+ export function kebabToPascal(str) {
10
+ return str
11
+ .split('-')
12
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
13
+ .join('');
14
+ }
@@ -0,0 +1,13 @@
1
+ const symbols = /[\r\n%#()<>?[\\\]^`{|}]/g;
2
+ export function addNameSpaceXML(data) {
3
+ if (data.indexOf(`http://www.w3.org/2000/svg`) < 0) {
4
+ data = data.replace(/<svg/g, `<svg xmlns='http://www.w3.org/2000/svg'`);
5
+ }
6
+ return data;
7
+ }
8
+ export function encodeSVG(data) {
9
+ data = data.replace(/"/g, `'`);
10
+ data = data.replace(/>\s{1,}</g, `><`);
11
+ data = data.replace(/\s{2,}/g, ` `);
12
+ return data.replace(symbols, encodeURIComponent);
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspot/ui",
3
- "version": "1.0.0-alpha.2",
3
+ "version": "1.0.0-alpha.4",
4
4
  "license": "UNLICENSED",
5
5
  "description": "A UI library for building Brightspot CMS components.",
6
6
  "main": "./dist/tailwind.config.ts",