@moduix/solid 1.0.0 → 1.1.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 (119) hide show
  1. package/dist/components/accordion/Accordion.js +19 -13
  2. package/dist/components/accordion/Accordion.jsx +7 -7
  3. package/dist/components/alert/Alert.js +19 -13
  4. package/dist/components/alert/Alert.jsx +6 -6
  5. package/dist/components/angle-slider/AngleSlider.d.ts +2 -6
  6. package/dist/components/angle-slider/AngleSlider.js +21 -16
  7. package/dist/components/angle-slider/AngleSlider.jsx +9 -10
  8. package/dist/components/avatar/Avatar.js +10 -7
  9. package/dist/components/avatar/Avatar.jsx +4 -4
  10. package/dist/components/button/Button.js +0 -5
  11. package/dist/components/button/Button.jsx +1 -3
  12. package/dist/components/button/Button_module.css +1 -3
  13. package/dist/components/card/Card.js +45 -36
  14. package/dist/components/card/Card.jsx +9 -9
  15. package/dist/components/card/Card_module.css +1 -1
  16. package/dist/components/carousel/Carousel.d.ts +1 -1
  17. package/dist/components/carousel/Carousel.js +32 -23
  18. package/dist/components/carousel/Carousel.jsx +12 -13
  19. package/dist/components/checkbox/Checkbox.js +16 -14
  20. package/dist/components/checkbox/Checkbox.jsx +6 -6
  21. package/dist/components/clipboard/Clipboard.js +28 -17
  22. package/dist/components/clipboard/Clipboard.jsx +12 -11
  23. package/dist/components/collapsible/Collapsible.js +16 -11
  24. package/dist/components/collapsible/Collapsible.jsx +6 -6
  25. package/dist/components/color-picker/ColorPicker.js +69 -48
  26. package/dist/components/color-picker/ColorPicker.jsx +28 -28
  27. package/dist/components/combobox/Combobox.js +44 -31
  28. package/dist/components/combobox/Combobox.jsx +18 -18
  29. package/dist/components/command-palette/CommandPalette.js +72 -53
  30. package/dist/components/command-palette/CommandPalette.jsx +29 -32
  31. package/dist/components/container/Container_module.css +1 -1
  32. package/dist/components/date-input/DateInput.js +18 -12
  33. package/dist/components/date-input/DateInput.jsx +7 -7
  34. package/dist/components/date-picker/DatePicker.js +73 -51
  35. package/dist/components/date-picker/DatePicker.jsx +29 -29
  36. package/dist/components/dialog/Dialog.js +30 -20
  37. package/dist/components/dialog/Dialog.jsx +10 -10
  38. package/dist/components/drawer/Drawer.js +45 -30
  39. package/dist/components/drawer/Drawer.jsx +15 -15
  40. package/dist/components/editable/Editable.js +24 -17
  41. package/dist/components/editable/Editable.jsx +10 -10
  42. package/dist/components/file-upload/FileUpload.js +39 -28
  43. package/dist/components/file-upload/FileUpload.jsx +17 -17
  44. package/dist/components/floating-panel/FloatingPanel.js +35 -23
  45. package/dist/components/floating-panel/FloatingPanel.jsx +12 -12
  46. package/dist/components/hover-card/HoverCard.js +16 -11
  47. package/dist/components/hover-card/HoverCard.jsx +6 -6
  48. package/dist/components/image-cropper/ImageCropper.js +21 -14
  49. package/dist/components/image-cropper/ImageCropper.jsx +7 -7
  50. package/dist/components/kbd/Kbd.js +8 -8
  51. package/dist/components/kbd/Kbd.jsx +2 -2
  52. package/dist/components/lightbox/Lightbox.d.ts +1 -0
  53. package/dist/components/lightbox/Lightbox.js +41 -27
  54. package/dist/components/lightbox/Lightbox.jsx +13 -12
  55. package/dist/components/listbox/Listbox.js +48 -32
  56. package/dist/components/listbox/Listbox.jsx +17 -17
  57. package/dist/components/marquee/Marquee.js +18 -12
  58. package/dist/components/marquee/Marquee.jsx +6 -6
  59. package/dist/components/menu/Menu.js +64 -43
  60. package/dist/components/menu/Menu.jsx +24 -24
  61. package/dist/components/navigation-menu/NavigationMenu.js +36 -24
  62. package/dist/components/navigation-menu/NavigationMenu.jsx +12 -12
  63. package/dist/components/number-input/NumberInput.js +19 -14
  64. package/dist/components/number-input/NumberInput.jsx +9 -9
  65. package/dist/components/pagination/Pagination.js +10 -9
  66. package/dist/components/pagination/Pagination.jsx +8 -8
  67. package/dist/components/password-input/PasswordInput.js +16 -11
  68. package/dist/components/password-input/PasswordInput.jsx +6 -6
  69. package/dist/components/pin-input/PinInput.js +15 -10
  70. package/dist/components/pin-input/PinInput.jsx +6 -6
  71. package/dist/components/popover/Popover.js +37 -25
  72. package/dist/components/popover/Popover.jsx +13 -13
  73. package/dist/components/progress-circular/ProgressCircular.js +18 -13
  74. package/dist/components/progress-circular/ProgressCircular.jsx +8 -8
  75. package/dist/components/progress-linear/ProgressLinear.js +21 -14
  76. package/dist/components/progress-linear/ProgressLinear.jsx +7 -7
  77. package/dist/components/qr-code/QrCode.js +8 -7
  78. package/dist/components/qr-code/QrCode.jsx +6 -6
  79. package/dist/components/rating-group/RatingGroup.js +15 -10
  80. package/dist/components/rating-group/RatingGroup.jsx +6 -6
  81. package/dist/components/segment-group/SegmentGroup.js +17 -12
  82. package/dist/components/segment-group/SegmentGroup.jsx +7 -7
  83. package/dist/components/select/Select.js +50 -35
  84. package/dist/components/select/Select.jsx +20 -20
  85. package/dist/components/sidebar/Sidebar.js +73 -43
  86. package/dist/components/sidebar/Sidebar.jsx +35 -27
  87. package/dist/components/signature-pad/SignaturePad.js +16 -12
  88. package/dist/components/signature-pad/SignaturePad.jsx +8 -8
  89. package/dist/components/slider/Slider.js +29 -20
  90. package/dist/components/slider/Slider.jsx +11 -11
  91. package/dist/components/split-button/SplitButton.d.ts +4 -3
  92. package/dist/components/split-button/SplitButton.js +21 -9
  93. package/dist/components/split-button/SplitButton.jsx +14 -7
  94. package/dist/components/splitter/Splitter.js +13 -9
  95. package/dist/components/splitter/Splitter.jsx +5 -5
  96. package/dist/components/steps/Steps.js +34 -23
  97. package/dist/components/steps/Steps.jsx +12 -12
  98. package/dist/components/swap/Swap.js +9 -6
  99. package/dist/components/swap/Swap.jsx +3 -3
  100. package/dist/components/switch/Switch.js +9 -7
  101. package/dist/components/switch/Switch.jsx +5 -5
  102. package/dist/components/tabs/Tabs.js +18 -12
  103. package/dist/components/tabs/Tabs.jsx +6 -6
  104. package/dist/components/tags-input/TagsInput.js +28 -20
  105. package/dist/components/tags-input/TagsInput.jsx +12 -12
  106. package/dist/components/timer/Timer.js +21 -14
  107. package/dist/components/timer/Timer.jsx +7 -7
  108. package/dist/components/toast/Toast.js +11 -9
  109. package/dist/components/toast/Toast.jsx +7 -7
  110. package/dist/components/toc/Toc.js +31 -20
  111. package/dist/components/toc/Toc.jsx +10 -10
  112. package/dist/components/tooltip/Tooltip.js +13 -9
  113. package/dist/components/tooltip/Tooltip.jsx +5 -5
  114. package/dist/components/tour/Tour.js +37 -25
  115. package/dist/components/tour/Tour.jsx +13 -13
  116. package/dist/components/tree-view/TreeView.js +39 -28
  117. package/dist/components/tree-view/TreeView.jsx +17 -17
  118. package/dist/styles/animations.css +8 -8
  119. package/package.json +9 -10
@@ -1,11 +1,13 @@
1
1
  import { createComponent, insert, memo, mergeProps, template } from "solid-js/web";
2
2
  import { ark } from "@ark-ui/solid/factory";
3
+ import { Splitter } from "@ark-ui/solid/splitter";
3
4
  import { clsx } from "clsx";
4
5
  import { createContext, splitProps, useContext } from "solid-js";
5
6
  import { ChevronLeftIcon } from "../../internal/icons/ui/Icons.js";
6
7
  import { Input } from "../input/index.js";
7
8
  import { Separator } from "../separator/index.js";
8
- import { Splitter, useSplitterContext } from "../splitter/index.js";
9
+ import { Splitter as index_js_Splitter, useSplitterContext } from "../splitter/index.js";
10
+ import Splitter_module from "../splitter/Splitter.module.js";
9
11
  import { Tooltip } from "../tooltip/index.js";
10
12
  import Sidebar_module from "./Sidebar.module.js";
11
13
  var _tmpl$ = /*#__PURE__*/ template("<span data-slot=sidebar-navigation-sub-label>");
@@ -62,7 +64,8 @@ function SidebarRoot(props) {
62
64
  'class',
63
65
  'defaultSize',
64
66
  'panelId',
65
- 'side'
67
+ 'side',
68
+ 'style'
66
69
  ]);
67
70
  const panelId = ()=>local.panelId ?? 'sidebar';
68
71
  const side = ()=>local.side ?? 'left';
@@ -85,7 +88,14 @@ function SidebarRoot(props) {
85
88
  },
86
89
  "data-slot": "sidebar-root",
87
90
  get ["class"] () {
88
- return clsx(Sidebar_module.root, local.class);
91
+ return clsx(Splitter_module.root, Sidebar_module.root, local.class);
92
+ },
93
+ get style () {
94
+ return memo(()=>'string' == typeof local.style)() ? `width:var(--moduix-splitter-width, 100%);height:var(--moduix-splitter-height, 28rem);${local.style}` : {
95
+ width: 'var(--moduix-splitter-width, 100%)',
96
+ height: 'var(--moduix-splitter-height, 28rem)',
97
+ ...local.style
98
+ };
89
99
  }
90
100
  }));
91
101
  }
@@ -121,7 +131,7 @@ function SidebarPanel(props) {
121
131
  return collapsed() ? 'collapsed' : 'expanded';
122
132
  },
123
133
  get ["class"] () {
124
- return clsx(Sidebar_module.panel, local.class);
134
+ return clsx(Splitter_module.panel, Sidebar_module.panel, local.class);
125
135
  }
126
136
  }));
127
137
  }
@@ -137,19 +147,23 @@ function SidebarInset(props) {
137
147
  },
138
148
  "data-slot": "sidebar-inset",
139
149
  get ["class"] () {
140
- return clsx(Sidebar_module.inset, local.class);
150
+ return clsx(Splitter_module.panel, Sidebar_module.inset, local.class);
141
151
  }
142
152
  }));
143
153
  }
144
154
  function SidebarResizeTrigger(props) {
145
155
  const [local, others] = splitProps(props, [
146
156
  'aria-label',
157
+ 'asChild',
147
158
  'class',
148
159
  'children'
149
160
  ]);
150
161
  const config = useSidebarConfig();
151
162
  const id = ()=>'left' === config.side() ? `${config.panelId()}:content` : `content:${config.panelId()}`;
152
163
  return createComponent(Splitter.ResizeTrigger, mergeProps(others, {
164
+ get asChild () {
165
+ return local.asChild;
166
+ },
153
167
  get id () {
154
168
  return id();
155
169
  },
@@ -161,10 +175,10 @@ function SidebarResizeTrigger(props) {
161
175
  },
162
176
  "data-slot": "sidebar-resize-trigger",
163
177
  get ["class"] () {
164
- return clsx(Sidebar_module.resizeTrigger, local.class);
178
+ return clsx(Splitter_module.resizeTrigger, Sidebar_module.resizeTrigger, local.class);
165
179
  },
166
180
  get children () {
167
- return local.children;
181
+ return memo(()=>!!(void 0 === local.children && !local.asChild))() ? createComponent(index_js_Splitter.ResizeTriggerIndicator, {}) : local.children;
168
182
  }
169
183
  }));
170
184
  }
@@ -203,7 +217,6 @@ function SidebarTrigger(props) {
203
217
  get ["data-side"] () {
204
218
  return config.side();
205
219
  },
206
- "data-slot": "sidebar-trigger",
207
220
  get ["data-state"] () {
208
221
  return collapsed() ? 'collapsed' : 'expanded';
209
222
  },
@@ -212,6 +225,7 @@ function SidebarTrigger(props) {
212
225
  },
213
226
  onClick: handleClick
214
227
  }, others, {
228
+ "data-slot": "sidebar-trigger",
215
229
  get children () {
216
230
  return memo(()=>!!(void 0 === local.children && !local.asChild))() ? createComponent(ChevronLeftIcon, {}) : local.children;
217
231
  }
@@ -224,11 +238,12 @@ function SidebarLabel(props) {
224
238
  return createComponent(ark.span, mergeProps({
225
239
  "data-scope": "sidebar",
226
240
  "data-part": "label",
227
- "data-slot": "sidebar-label",
228
241
  get ["class"] () {
229
242
  return clsx(Sidebar_module.label, local.class);
230
243
  }
231
- }, others));
244
+ }, others, {
245
+ "data-slot": "sidebar-label"
246
+ }));
232
247
  }
233
248
  function SidebarHeader(props) {
234
249
  const [local, others] = splitProps(props, [
@@ -237,11 +252,12 @@ function SidebarHeader(props) {
237
252
  return createComponent(ark.header, mergeProps({
238
253
  "data-scope": "sidebar",
239
254
  "data-part": "header",
240
- "data-slot": "sidebar-header",
241
255
  get ["class"] () {
242
256
  return clsx(Sidebar_module.header, local.class);
243
257
  }
244
- }, others));
258
+ }, others, {
259
+ "data-slot": "sidebar-header"
260
+ }));
245
261
  }
246
262
  function SidebarContent(props) {
247
263
  const [local, others] = splitProps(props, [
@@ -250,11 +266,12 @@ function SidebarContent(props) {
250
266
  return createComponent(ark.div, mergeProps({
251
267
  "data-scope": "sidebar",
252
268
  "data-part": "content",
253
- "data-slot": "sidebar-content",
254
269
  get ["class"] () {
255
270
  return clsx(Sidebar_module.content, local.class);
256
271
  }
257
- }, others));
272
+ }, others, {
273
+ "data-slot": "sidebar-content"
274
+ }));
258
275
  }
259
276
  function SidebarExpandedContent(props) {
260
277
  const [local, others] = splitProps(props, [
@@ -264,11 +281,11 @@ function SidebarExpandedContent(props) {
264
281
  return createComponent(ark.div, mergeProps({
265
282
  "data-scope": "sidebar",
266
283
  "data-part": "expanded-content",
267
- "data-slot": "sidebar-expanded-content",
268
284
  get ["class"] () {
269
285
  return local.class;
270
286
  }
271
287
  }, others, {
288
+ "data-slot": "sidebar-expanded-content",
272
289
  get hidden () {
273
290
  return collapsed();
274
291
  }
@@ -282,11 +299,11 @@ function SidebarCollapsedContent(props) {
282
299
  return createComponent(ark.div, mergeProps({
283
300
  "data-scope": "sidebar",
284
301
  "data-part": "collapsed-content",
285
- "data-slot": "sidebar-collapsed-content",
286
302
  get ["class"] () {
287
303
  return local.class;
288
304
  }
289
305
  }, others, {
306
+ "data-slot": "sidebar-collapsed-content",
290
307
  get hidden () {
291
308
  return !collapsed();
292
309
  }
@@ -299,11 +316,12 @@ function SidebarFooter(props) {
299
316
  return createComponent(ark.footer, mergeProps({
300
317
  "data-scope": "sidebar",
301
318
  "data-part": "footer",
302
- "data-slot": "sidebar-footer",
303
319
  get ["class"] () {
304
320
  return clsx(Sidebar_module.footer, local.class);
305
321
  }
306
- }, others));
322
+ }, others, {
323
+ "data-slot": "sidebar-footer"
324
+ }));
307
325
  }
308
326
  function SidebarGroup(props) {
309
327
  const [local, others] = splitProps(props, [
@@ -312,11 +330,12 @@ function SidebarGroup(props) {
312
330
  return createComponent(ark.section, mergeProps({
313
331
  "data-scope": "sidebar",
314
332
  "data-part": "group",
315
- "data-slot": "sidebar-group",
316
333
  get ["class"] () {
317
334
  return clsx(Sidebar_module.group, local.class);
318
335
  }
319
- }, others));
336
+ }, others, {
337
+ "data-slot": "sidebar-group"
338
+ }));
320
339
  }
321
340
  function SidebarGroupLabel(props) {
322
341
  const [local, others] = splitProps(props, [
@@ -325,11 +344,12 @@ function SidebarGroupLabel(props) {
325
344
  return createComponent(ark.h3, mergeProps({
326
345
  "data-scope": "sidebar",
327
346
  "data-part": "group-label",
328
- "data-slot": "sidebar-group-label",
329
347
  get ["class"] () {
330
348
  return clsx(Sidebar_module.groupLabel, local.class);
331
349
  }
332
- }, others));
350
+ }, others, {
351
+ "data-slot": "sidebar-group-label"
352
+ }));
333
353
  }
334
354
  function SidebarGroupHeader(props) {
335
355
  const [local, others] = splitProps(props, [
@@ -338,11 +358,12 @@ function SidebarGroupHeader(props) {
338
358
  return createComponent(ark.div, mergeProps({
339
359
  "data-scope": "sidebar",
340
360
  "data-part": "group-header",
341
- "data-slot": "sidebar-group-header",
342
361
  get ["class"] () {
343
362
  return clsx(Sidebar_module.groupHeader, local.class);
344
363
  }
345
- }, others));
364
+ }, others, {
365
+ "data-slot": "sidebar-group-header"
366
+ }));
346
367
  }
347
368
  function SidebarGroupAction(props) {
348
369
  const [local, others] = splitProps(props, [
@@ -355,11 +376,12 @@ function SidebarGroupAction(props) {
355
376
  },
356
377
  "data-scope": "sidebar",
357
378
  "data-part": "group-action",
358
- "data-slot": "sidebar-group-action",
359
379
  get ["class"] () {
360
380
  return clsx(Sidebar_module.groupAction, local.class);
361
381
  }
362
- }, others));
382
+ }, others, {
383
+ "data-slot": "sidebar-group-action"
384
+ }));
363
385
  }
364
386
  function SidebarNavigationList(props) {
365
387
  const [local, others] = splitProps(props, [
@@ -368,11 +390,12 @@ function SidebarNavigationList(props) {
368
390
  return createComponent(ark.ul, mergeProps({
369
391
  "data-scope": "sidebar",
370
392
  "data-part": "navigation-list",
371
- "data-slot": "sidebar-navigation-list",
372
393
  get ["class"] () {
373
394
  return clsx(Sidebar_module.menu, local.class);
374
395
  }
375
- }, others));
396
+ }, others, {
397
+ "data-slot": "sidebar-navigation-list"
398
+ }));
376
399
  }
377
400
  function SidebarNavigationItem(props) {
378
401
  const [local, others] = splitProps(props, [
@@ -381,11 +404,12 @@ function SidebarNavigationItem(props) {
381
404
  return createComponent(ark.li, mergeProps({
382
405
  "data-scope": "sidebar",
383
406
  "data-part": "navigation-item",
384
- "data-slot": "sidebar-navigation-item",
385
407
  get ["class"] () {
386
408
  return clsx(Sidebar_module.menuItem, local.class);
387
409
  }
388
- }, others));
410
+ }, others, {
411
+ "data-slot": "sidebar-navigation-item"
412
+ }));
389
413
  }
390
414
  function SidebarNavigationButton(props) {
391
415
  const [local, others] = splitProps(props, [
@@ -408,7 +432,6 @@ function SidebarNavigationButton(props) {
408
432
  },
409
433
  "data-scope": "sidebar",
410
434
  "data-part": "navigation-button",
411
- "data-slot": "sidebar-navigation-button",
412
435
  get ["data-active"] () {
413
436
  return local.active ? '' : void 0;
414
437
  },
@@ -418,7 +441,9 @@ function SidebarNavigationButton(props) {
418
441
  get ["class"] () {
419
442
  return clsx(Sidebar_module.menuButton, local.class);
420
443
  }
421
- }, others));
444
+ }, others, {
445
+ "data-slot": "sidebar-navigation-button"
446
+ }));
422
447
  }
423
448
  function SidebarNavigationBadge(props) {
424
449
  const [local, others] = splitProps(props, [
@@ -427,11 +452,12 @@ function SidebarNavigationBadge(props) {
427
452
  return createComponent(ark.span, mergeProps({
428
453
  "data-scope": "sidebar",
429
454
  "data-part": "navigation-badge",
430
- "data-slot": "sidebar-navigation-badge",
431
455
  get ["class"] () {
432
456
  return clsx(Sidebar_module.menuBadge, local.class);
433
457
  }
434
- }, others));
458
+ }, others, {
459
+ "data-slot": "sidebar-navigation-badge"
460
+ }));
435
461
  }
436
462
  function SidebarNavigationSubList(props) {
437
463
  const [local, others] = splitProps(props, [
@@ -440,11 +466,12 @@ function SidebarNavigationSubList(props) {
440
466
  return createComponent(ark.ul, mergeProps({
441
467
  "data-scope": "sidebar",
442
468
  "data-part": "navigation-sub-list",
443
- "data-slot": "sidebar-navigation-sub-list",
444
469
  get ["class"] () {
445
470
  return clsx(Sidebar_module.menuSub, local.class);
446
471
  }
447
- }, others));
472
+ }, others, {
473
+ "data-slot": "sidebar-navigation-sub-list"
474
+ }));
448
475
  }
449
476
  function SidebarNavigationSubItem(props) {
450
477
  const [local, others] = splitProps(props, [
@@ -453,11 +480,12 @@ function SidebarNavigationSubItem(props) {
453
480
  return createComponent(ark.li, mergeProps({
454
481
  "data-scope": "sidebar",
455
482
  "data-part": "navigation-sub-item",
456
- "data-slot": "sidebar-navigation-sub-item",
457
483
  get ["class"] () {
458
484
  return clsx(Sidebar_module.menuSubItem, local.class);
459
485
  }
460
- }, others));
486
+ }, others, {
487
+ "data-slot": "sidebar-navigation-sub-item"
488
+ }));
461
489
  }
462
490
  function SidebarNavigationSubButton(props) {
463
491
  const [local, others] = splitProps(props, [
@@ -476,7 +504,6 @@ function SidebarNavigationSubButton(props) {
476
504
  },
477
505
  "data-scope": "sidebar",
478
506
  "data-part": "navigation-sub-button",
479
- "data-slot": "sidebar-navigation-sub-button",
480
507
  get ["data-active"] () {
481
508
  return local.active ? '' : void 0;
482
509
  },
@@ -484,6 +511,7 @@ function SidebarNavigationSubButton(props) {
484
511
  return clsx(Sidebar_module.menuSubButton, local.class);
485
512
  }
486
513
  }, others, {
514
+ "data-slot": "sidebar-navigation-sub-button",
487
515
  get children () {
488
516
  return memo(()=>'string' == typeof local.children)() ? (()=>{
489
517
  var _el$ = _tmpl$();
@@ -544,22 +572,24 @@ function SidebarInput(props) {
544
572
  'class'
545
573
  ]);
546
574
  return createComponent(Input.Root, mergeProps({
547
- "data-slot": "sidebar-input",
548
575
  get ["class"] () {
549
576
  return clsx(Sidebar_module.input, local.class);
550
577
  }
551
- }, others));
578
+ }, others, {
579
+ "data-slot": "sidebar-input"
580
+ }));
552
581
  }
553
582
  function SidebarSeparator(props) {
554
583
  const [local, others] = splitProps(props, [
555
584
  'class'
556
585
  ]);
557
586
  return createComponent(Separator.Root, mergeProps({
558
- "data-slot": "sidebar-separator",
559
587
  get ["class"] () {
560
588
  return clsx(Sidebar_module.separator, local.class);
561
589
  }
562
- }, others));
590
+ }, others, {
591
+ "data-slot": "sidebar-separator"
592
+ }));
563
593
  }
564
594
  const Sidebar = Object.assign(SidebarRoot, {
565
595
  Root: SidebarRoot,
@@ -1,10 +1,12 @@
1
1
  import { ark } from "@ark-ui/solid/factory";
2
+ import { Splitter } from "@ark-ui/solid/splitter";
2
3
  import { clsx } from "clsx";
3
4
  import { createContext, splitProps, useContext } from "solid-js";
4
5
  import { ChevronLeftIcon } from "../../internal/icons/ui/Icons.jsx";
5
6
  import { Input } from "../input/index.jsx";
6
7
  import { Separator } from "../separator/index.jsx";
7
- import { Splitter, useSplitterContext } from "../splitter/index.jsx";
8
+ import { Splitter as index_jsx_Splitter, useSplitterContext } from "../splitter/index.jsx";
9
+ import Splitter_module from "../splitter/Splitter.module.jsx";
8
10
  import { Tooltip } from "../tooltip/index.jsx";
9
11
  import Sidebar_module from "./Sidebar.module.jsx";
10
12
  const sidebarPanel = {
@@ -60,7 +62,8 @@ function SidebarRoot(props) {
60
62
  'class',
61
63
  'defaultSize',
62
64
  'panelId',
63
- 'side'
65
+ 'side',
66
+ 'style'
64
67
  ]);
65
68
  const panelId = ()=>local.panelId ?? 'sidebar';
66
69
  const side = ()=>local.side ?? 'left';
@@ -68,7 +71,11 @@ function SidebarRoot(props) {
68
71
  panelId,
69
72
  side
70
73
  }}>
71
- <Splitter.Root {...others} panels={getDefaultPanels(side(), panelId())} defaultSize={local.defaultSize ?? getDefaultSidebarSize(side())} orientation="horizontal" data-side={side()} data-slot="sidebar-root" class={clsx(Sidebar_module.root, local.class)}/>
74
+ <Splitter.Root {...others} panels={getDefaultPanels(side(), panelId())} defaultSize={local.defaultSize ?? getDefaultSidebarSize(side())} orientation="horizontal" data-side={side()} data-slot="sidebar-root" class={clsx(Splitter_module.root, Sidebar_module.root, local.class)} style={'string' == typeof local.style ? `width:var(--moduix-splitter-width, 100%);height:var(--moduix-splitter-height, 28rem);${local.style}` : {
75
+ width: 'var(--moduix-splitter-width, 100%)',
76
+ height: 'var(--moduix-splitter-height, 28rem)',
77
+ ...local.style
78
+ }}/>
72
79
  </SidebarConfigContext.Provider>;
73
80
  }
74
81
  function useSidebar() {
@@ -89,25 +96,26 @@ function SidebarPanel(props) {
89
96
  const config = useSidebarConfig();
90
97
  const splitter = useSplitterContext();
91
98
  const collapsed = ()=>splitter().isPanelCollapsed(config.panelId());
92
- return <Splitter.Panel {...others} id={config.panelId()} data-side={config.side()} data-slot="sidebar-panel" data-state={collapsed() ? 'collapsed' : 'expanded'} class={clsx(Sidebar_module.panel, local.class)}/>;
99
+ return <Splitter.Panel {...others} id={config.panelId()} data-side={config.side()} data-slot="sidebar-panel" data-state={collapsed() ? 'collapsed' : 'expanded'} class={clsx(Splitter_module.panel, Sidebar_module.panel, local.class)}/>;
93
100
  }
94
101
  function SidebarInset(props) {
95
102
  const [local, others] = splitProps(props, [
96
103
  'class'
97
104
  ]);
98
105
  const config = useSidebarConfig();
99
- return <Splitter.Panel {...others} id="content" data-side={config.side()} data-slot="sidebar-inset" class={clsx(Sidebar_module.inset, local.class)}/>;
106
+ return <Splitter.Panel {...others} id="content" data-side={config.side()} data-slot="sidebar-inset" class={clsx(Splitter_module.panel, Sidebar_module.inset, local.class)}/>;
100
107
  }
101
108
  function SidebarResizeTrigger(props) {
102
109
  const [local, others] = splitProps(props, [
103
110
  'aria-label',
111
+ 'asChild',
104
112
  'class',
105
113
  'children'
106
114
  ]);
107
115
  const config = useSidebarConfig();
108
116
  const id = ()=>'left' === config.side() ? `${config.panelId()}:content` : `content:${config.panelId()}`;
109
- return <Splitter.ResizeTrigger {...others} id={id()} aria-label={local['aria-label'] ?? 'Resize sidebar'} data-side={config.side()} data-slot="sidebar-resize-trigger" class={clsx(Sidebar_module.resizeTrigger, local.class)}>
110
- {local.children}
117
+ return <Splitter.ResizeTrigger {...others} asChild={local.asChild} id={id()} aria-label={local['aria-label'] ?? 'Resize sidebar'} data-side={config.side()} data-slot="sidebar-resize-trigger" class={clsx(Splitter_module.resizeTrigger, Sidebar_module.resizeTrigger, local.class)}>
118
+ {void 0 === local.children && !local.asChild ? <index_jsx_Splitter.ResizeTriggerIndicator/> : local.children}
111
119
  </Splitter.ResizeTrigger>;
112
120
  }
113
121
  function SidebarTrigger(props) {
@@ -127,7 +135,7 @@ function SidebarTrigger(props) {
127
135
  if (event.defaultPrevented) return;
128
136
  toggleSidebarPanel(splitter, config.panelId());
129
137
  };
130
- return <ark.button asChild={local.asChild} type={local.type ?? 'button'} aria-label={local['aria-label'] ?? 'Toggle sidebar'} aria-expanded={!collapsed()} data-scope="sidebar" data-part="trigger" data-side={config.side()} data-slot="sidebar-trigger" data-state={collapsed() ? 'collapsed' : 'expanded'} class={clsx(Sidebar_module.trigger, local.class)} onClick={handleClick} {...others}>
138
+ return <ark.button asChild={local.asChild} type={local.type ?? 'button'} aria-label={local['aria-label'] ?? 'Toggle sidebar'} aria-expanded={!collapsed()} data-scope="sidebar" data-part="trigger" data-side={config.side()} data-state={collapsed() ? 'collapsed' : 'expanded'} class={clsx(Sidebar_module.trigger, local.class)} onClick={handleClick} {...others} data-slot="sidebar-trigger">
131
139
  {void 0 === local.children && !local.asChild ? <ChevronLeftIcon/> : local.children}
132
140
  </ark.button>;
133
141
  }
@@ -135,76 +143,76 @@ function SidebarLabel(props) {
135
143
  const [local, others] = splitProps(props, [
136
144
  'class'
137
145
  ]);
138
- return <ark.span data-scope="sidebar" data-part="label" data-slot="sidebar-label" class={clsx(Sidebar_module.label, local.class)} {...others}/>;
146
+ return <ark.span data-scope="sidebar" data-part="label" class={clsx(Sidebar_module.label, local.class)} {...others} data-slot="sidebar-label"/>;
139
147
  }
140
148
  function SidebarHeader(props) {
141
149
  const [local, others] = splitProps(props, [
142
150
  'class'
143
151
  ]);
144
- return <ark.header data-scope="sidebar" data-part="header" data-slot="sidebar-header" class={clsx(Sidebar_module.header, local.class)} {...others}/>;
152
+ return <ark.header data-scope="sidebar" data-part="header" class={clsx(Sidebar_module.header, local.class)} {...others} data-slot="sidebar-header"/>;
145
153
  }
146
154
  function SidebarContent(props) {
147
155
  const [local, others] = splitProps(props, [
148
156
  'class'
149
157
  ]);
150
- return <ark.div data-scope="sidebar" data-part="content" data-slot="sidebar-content" class={clsx(Sidebar_module.content, local.class)} {...others}/>;
158
+ return <ark.div data-scope="sidebar" data-part="content" class={clsx(Sidebar_module.content, local.class)} {...others} data-slot="sidebar-content"/>;
151
159
  }
152
160
  function SidebarExpandedContent(props) {
153
161
  const [local, others] = splitProps(props, [
154
162
  'class'
155
163
  ]);
156
164
  const { collapsed } = useSidebar();
157
- return <ark.div data-scope="sidebar" data-part="expanded-content" data-slot="sidebar-expanded-content" class={local.class} {...others} hidden={collapsed()}/>;
165
+ return <ark.div data-scope="sidebar" data-part="expanded-content" class={local.class} {...others} data-slot="sidebar-expanded-content" hidden={collapsed()}/>;
158
166
  }
159
167
  function SidebarCollapsedContent(props) {
160
168
  const [local, others] = splitProps(props, [
161
169
  'class'
162
170
  ]);
163
171
  const { collapsed } = useSidebar();
164
- return <ark.div data-scope="sidebar" data-part="collapsed-content" data-slot="sidebar-collapsed-content" class={local.class} {...others} hidden={!collapsed()}/>;
172
+ return <ark.div data-scope="sidebar" data-part="collapsed-content" class={local.class} {...others} data-slot="sidebar-collapsed-content" hidden={!collapsed()}/>;
165
173
  }
166
174
  function SidebarFooter(props) {
167
175
  const [local, others] = splitProps(props, [
168
176
  'class'
169
177
  ]);
170
- return <ark.footer data-scope="sidebar" data-part="footer" data-slot="sidebar-footer" class={clsx(Sidebar_module.footer, local.class)} {...others}/>;
178
+ return <ark.footer data-scope="sidebar" data-part="footer" class={clsx(Sidebar_module.footer, local.class)} {...others} data-slot="sidebar-footer"/>;
171
179
  }
172
180
  function SidebarGroup(props) {
173
181
  const [local, others] = splitProps(props, [
174
182
  'class'
175
183
  ]);
176
- return <ark.section data-scope="sidebar" data-part="group" data-slot="sidebar-group" class={clsx(Sidebar_module.group, local.class)} {...others}/>;
184
+ return <ark.section data-scope="sidebar" data-part="group" class={clsx(Sidebar_module.group, local.class)} {...others} data-slot="sidebar-group"/>;
177
185
  }
178
186
  function SidebarGroupLabel(props) {
179
187
  const [local, others] = splitProps(props, [
180
188
  'class'
181
189
  ]);
182
- return <ark.h3 data-scope="sidebar" data-part="group-label" data-slot="sidebar-group-label" class={clsx(Sidebar_module.groupLabel, local.class)} {...others}/>;
190
+ return <ark.h3 data-scope="sidebar" data-part="group-label" class={clsx(Sidebar_module.groupLabel, local.class)} {...others} data-slot="sidebar-group-label"/>;
183
191
  }
184
192
  function SidebarGroupHeader(props) {
185
193
  const [local, others] = splitProps(props, [
186
194
  'class'
187
195
  ]);
188
- return <ark.div data-scope="sidebar" data-part="group-header" data-slot="sidebar-group-header" class={clsx(Sidebar_module.groupHeader, local.class)} {...others}/>;
196
+ return <ark.div data-scope="sidebar" data-part="group-header" class={clsx(Sidebar_module.groupHeader, local.class)} {...others} data-slot="sidebar-group-header"/>;
189
197
  }
190
198
  function SidebarGroupAction(props) {
191
199
  const [local, others] = splitProps(props, [
192
200
  'class',
193
201
  'type'
194
202
  ]);
195
- return <ark.button type={local.type ?? 'button'} data-scope="sidebar" data-part="group-action" data-slot="sidebar-group-action" class={clsx(Sidebar_module.groupAction, local.class)} {...others}/>;
203
+ return <ark.button type={local.type ?? 'button'} data-scope="sidebar" data-part="group-action" class={clsx(Sidebar_module.groupAction, local.class)} {...others} data-slot="sidebar-group-action"/>;
196
204
  }
197
205
  function SidebarNavigationList(props) {
198
206
  const [local, others] = splitProps(props, [
199
207
  'class'
200
208
  ]);
201
- return <ark.ul data-scope="sidebar" data-part="navigation-list" data-slot="sidebar-navigation-list" class={clsx(Sidebar_module.menu, local.class)} {...others}/>;
209
+ return <ark.ul data-scope="sidebar" data-part="navigation-list" class={clsx(Sidebar_module.menu, local.class)} {...others} data-slot="sidebar-navigation-list"/>;
202
210
  }
203
211
  function SidebarNavigationItem(props) {
204
212
  const [local, others] = splitProps(props, [
205
213
  'class'
206
214
  ]);
207
- return <ark.li data-scope="sidebar" data-part="navigation-item" data-slot="sidebar-navigation-item" class={clsx(Sidebar_module.menuItem, local.class)} {...others}/>;
215
+ return <ark.li data-scope="sidebar" data-part="navigation-item" class={clsx(Sidebar_module.menuItem, local.class)} {...others} data-slot="sidebar-navigation-item"/>;
208
216
  }
209
217
  function SidebarNavigationButton(props) {
210
218
  const [local, others] = splitProps(props, [
@@ -215,25 +223,25 @@ function SidebarNavigationButton(props) {
215
223
  'size',
216
224
  'type'
217
225
  ]);
218
- return <ark.button asChild={local.asChild} type={local.type ?? 'button'} aria-current={local['aria-current'] ?? (local.active ? 'page' : void 0)} data-scope="sidebar" data-part="navigation-button" data-slot="sidebar-navigation-button" data-active={local.active ? '' : void 0} data-size={local.size ?? 'md'} class={clsx(Sidebar_module.menuButton, local.class)} {...others}/>;
226
+ return <ark.button asChild={local.asChild} type={local.type ?? 'button'} aria-current={local['aria-current'] ?? (local.active ? 'page' : void 0)} data-scope="sidebar" data-part="navigation-button" data-active={local.active ? '' : void 0} data-size={local.size ?? 'md'} class={clsx(Sidebar_module.menuButton, local.class)} {...others} data-slot="sidebar-navigation-button"/>;
219
227
  }
220
228
  function SidebarNavigationBadge(props) {
221
229
  const [local, others] = splitProps(props, [
222
230
  'class'
223
231
  ]);
224
- return <ark.span data-scope="sidebar" data-part="navigation-badge" data-slot="sidebar-navigation-badge" class={clsx(Sidebar_module.menuBadge, local.class)} {...others}/>;
232
+ return <ark.span data-scope="sidebar" data-part="navigation-badge" class={clsx(Sidebar_module.menuBadge, local.class)} {...others} data-slot="sidebar-navigation-badge"/>;
225
233
  }
226
234
  function SidebarNavigationSubList(props) {
227
235
  const [local, others] = splitProps(props, [
228
236
  'class'
229
237
  ]);
230
- return <ark.ul data-scope="sidebar" data-part="navigation-sub-list" data-slot="sidebar-navigation-sub-list" class={clsx(Sidebar_module.menuSub, local.class)} {...others}/>;
238
+ return <ark.ul data-scope="sidebar" data-part="navigation-sub-list" class={clsx(Sidebar_module.menuSub, local.class)} {...others} data-slot="sidebar-navigation-sub-list"/>;
231
239
  }
232
240
  function SidebarNavigationSubItem(props) {
233
241
  const [local, others] = splitProps(props, [
234
242
  'class'
235
243
  ]);
236
- return <ark.li data-scope="sidebar" data-part="navigation-sub-item" data-slot="sidebar-navigation-sub-item" class={clsx(Sidebar_module.menuSubItem, local.class)} {...others}/>;
244
+ return <ark.li data-scope="sidebar" data-part="navigation-sub-item" class={clsx(Sidebar_module.menuSubItem, local.class)} {...others} data-slot="sidebar-navigation-sub-item"/>;
237
245
  }
238
246
  function SidebarNavigationSubButton(props) {
239
247
  const [local, others] = splitProps(props, [
@@ -243,7 +251,7 @@ function SidebarNavigationSubButton(props) {
243
251
  'children',
244
252
  'class'
245
253
  ]);
246
- return <ark.a asChild={local.asChild} aria-current={local['aria-current'] ?? (local.active ? 'page' : void 0)} data-scope="sidebar" data-part="navigation-sub-button" data-slot="sidebar-navigation-sub-button" data-active={local.active ? '' : void 0} class={clsx(Sidebar_module.menuSubButton, local.class)} {...others}>
254
+ return <ark.a asChild={local.asChild} aria-current={local['aria-current'] ?? (local.active ? 'page' : void 0)} data-scope="sidebar" data-part="navigation-sub-button" data-active={local.active ? '' : void 0} class={clsx(Sidebar_module.menuSubButton, local.class)} {...others} data-slot="sidebar-navigation-sub-button">
247
255
  {'string' == typeof local.children ? <span data-slot="sidebar-navigation-sub-label">{local.children}</span> : local.children}
248
256
  </ark.a>;
249
257
  }
@@ -271,13 +279,13 @@ function SidebarInput(props) {
271
279
  const [local, others] = splitProps(props, [
272
280
  'class'
273
281
  ]);
274
- return <Input.Root data-slot="sidebar-input" class={clsx(Sidebar_module.input, local.class)} {...others}/>;
282
+ return <Input.Root class={clsx(Sidebar_module.input, local.class)} {...others} data-slot="sidebar-input"/>;
275
283
  }
276
284
  function SidebarSeparator(props) {
277
285
  const [local, others] = splitProps(props, [
278
286
  'class'
279
287
  ]);
280
- return <Separator.Root data-slot="sidebar-separator" class={clsx(Sidebar_module.separator, local.class)} {...others}/>;
288
+ return <Separator.Root class={clsx(Sidebar_module.separator, local.class)} {...others} data-slot="sidebar-separator"/>;
281
289
  }
282
290
  const Sidebar = Object.assign(SidebarRoot, {
283
291
  Root: SidebarRoot,