@streamscloud/kit 0.2.34 → 0.2.36

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.
@@ -100,29 +100,4 @@ A collapsible section within a GroupedSidebar. Renders a trigger button with che
100
100
  }
101
101
  .grouped-sidebar-section__content--fill {
102
102
  flex: 1;
103
- overflow-y: auto;
104
- --_cross-browser-scrollbar--thumb-color: transparent;
105
- --_cross-browser-scrollbar--track-color: transparent;
106
- }
107
- .grouped-sidebar-section__content--fill:hover {
108
- --_cross-browser-scrollbar--thumb-color: var(--scrollbar--thumb-color, light-dark(#d1d5db, #4b5563));
109
- --_cross-browser-scrollbar--track-color: var(--scrollbar--track-color, transparent);
110
- }
111
- .grouped-sidebar-section__content--fill::-webkit-scrollbar {
112
- width: 6px;
113
- height: 6px;
114
- }
115
- .grouped-sidebar-section__content--fill::-webkit-scrollbar-track {
116
- background: var(--_cross-browser-scrollbar--track-color);
117
- border-radius: 100vw;
118
- }
119
- .grouped-sidebar-section__content--fill::-webkit-scrollbar-thumb {
120
- background: var(--_cross-browser-scrollbar--thumb-color);
121
- border-radius: 100vw;
122
- }
123
- @supports (scrollbar-color: transparent transparent) {
124
- .grouped-sidebar-section__content--fill {
125
- scrollbar-color: var(--_cross-browser-scrollbar--thumb-color) var(--_cross-browser-scrollbar--track-color);
126
- scrollbar-width: thin;
127
- }
128
103
  }</style>
@@ -34,7 +34,7 @@ const selectedGroup = $derived(settings.groups.find((d) => d.id === settings.sel
34
34
  </script>
35
35
 
36
36
  <div class="grouped-sidebar">
37
- {#if (settings.groups.length > 1 || settings.alwaysShowAllGroups) && selectedGroup}
37
+ {#if (settings.groups.length > 1 || !settings.hideGroupsWhenSingle) && selectedGroup}
38
38
  <div class="grouped-sidebar__header">
39
39
  <SegmentedControl
40
40
  segments={settings.groups.map((g) => ({ id: g.id, label: g.name, invalid: !g.isValid }))}
@@ -48,7 +48,7 @@ const selectedGroup = $derived(settings.groups.find((d) => d.id === settings.sel
48
48
  <Section
49
49
  section={section}
50
50
  expandToFill={settings.expandToFill}
51
- showSectionCollapser={selectedGroup.sections.length > 1 || settings.alwaysShowAllSections}
51
+ showSectionCollapser={selectedGroup.sections.length > 1 || !settings.hideSectionsWhenSingle}
52
52
  on={{ toggleSection: handleToggleSection }} />
53
53
  {/each}
54
54
  {/if}
@@ -5,16 +5,21 @@ export declare class GroupedSidebarSettings {
5
5
  selectedGroupId: string;
6
6
  allowMultipleExpandedSections: boolean;
7
7
  allowCloseAllSections: boolean;
8
- alwaysShowAllSections: boolean;
9
- alwaysShowAllGroups: boolean;
8
+ hideGroupsWhenSingle: boolean;
9
+ hideSectionsWhenSingle: boolean;
10
10
  expandToFill: boolean;
11
11
  constructor(init: {
12
12
  groups: SidebarGroupInit[];
13
13
  initiallySelectedGroupId?: string;
14
+ /** Allow more than one section open at the same time @default false */
14
15
  allowMultipleExpandedSections?: boolean;
16
+ /** Allow collapsing every section (otherwise at least one stays open) @default false */
15
17
  allowCloseAllSections?: boolean;
16
- alwaysShowAllGroups?: boolean;
17
- alwaysShowAllSections?: boolean;
18
+ /** Hide the group tabs when there is only one group @default false */
19
+ hideGroupsWhenSingle?: boolean;
20
+ /** Hide section headers when a group has only one section @default false */
21
+ hideSectionsWhenSingle?: boolean;
22
+ /** Expanded sections stretch to fill available height @default true */
18
23
  expandToFill?: boolean;
19
24
  });
20
25
  }
@@ -48,15 +53,18 @@ export interface SidebarGroupInit {
48
53
  name: string;
49
54
  sections: SidebarSectionInit[];
50
55
  onSelected?: () => void;
56
+ /** Aggregated with section validators to determine group validity */
51
57
  validator?: SidebarValidator;
52
58
  }
53
59
  export interface SidebarSectionInit {
54
60
  id?: string;
55
61
  name: string;
56
62
  expanded?: boolean;
63
+ /** Remove default content padding @default false */
57
64
  withoutPaddings?: boolean;
58
65
  component: DynamicComponentModel | Snippet;
59
66
  onExpandedChanged?: (val: boolean) => void;
67
+ /** Shows error styling on section title when invalid */
60
68
  validator?: SidebarValidator;
61
69
  }
62
70
  export type SidebarValidator = {
@@ -5,16 +5,16 @@ export class GroupedSidebarSettings {
5
5
  selectedGroupId = $state('');
6
6
  allowMultipleExpandedSections = $state(false);
7
7
  allowCloseAllSections = $state(false);
8
- alwaysShowAllSections = $state(false);
9
- alwaysShowAllGroups = $state(false);
8
+ hideGroupsWhenSingle = $state(false);
9
+ hideSectionsWhenSingle = $state(false);
10
10
  expandToFill = $state(true);
11
11
  constructor(init) {
12
12
  this.groups = init.groups.map((g) => new SidebarGroupModel(g));
13
13
  this.selectedGroupId = init.initiallySelectedGroupId ?? '';
14
14
  this.allowMultipleExpandedSections = init.allowMultipleExpandedSections ?? false;
15
15
  this.allowCloseAllSections = init.allowCloseAllSections ?? false;
16
- this.alwaysShowAllGroups = init.alwaysShowAllGroups ?? false;
17
- this.alwaysShowAllSections = init.alwaysShowAllSections ?? false;
16
+ this.hideGroupsWhenSingle = init.hideGroupsWhenSingle ?? false;
17
+ this.hideSectionsWhenSingle = init.hideSectionsWhenSingle ?? false;
18
18
  this.expandToFill = init.expandToFill ?? true;
19
19
  }
20
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/kit",
3
- "version": "0.2.34",
3
+ "version": "0.2.36",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",