@wheelhouse/ui 0.2.3 → 0.2.5
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/dist/blocks/columns/columns-types.d.ts +25 -1
- package/dist/blocks/columns/columns-types.d.ts.map +1 -1
- package/dist/blocks/columns/columns-types.js +4 -0
- package/dist/blocks/columns/columns-utils.d.ts +31 -1
- package/dist/blocks/columns/columns-utils.d.ts.map +1 -1
- package/dist/blocks/columns/columns-utils.js +86 -1
- package/dist/blocks/columns/columns.d.ts +1 -1
- package/dist/blocks/columns/columns.d.ts.map +1 -1
- package/dist/blocks/columns/columns.js +81 -20
- package/dist/blocks/columns/columns.stories.d.ts +1 -0
- package/dist/blocks/columns/columns.stories.d.ts.map +1 -1
- package/dist/blocks/columns/columns.stories.js +21 -1
- package/dist/blocks/columns/index.d.ts +1 -1
- package/dist/blocks/columns/index.d.ts.map +1 -1
- package/dist/blocks/floating-menu-widget/floating-menu-widget.d.ts +26 -0
- package/dist/blocks/floating-menu-widget/floating-menu-widget.d.ts.map +1 -0
- package/dist/blocks/floating-menu-widget/floating-menu-widget.js +200 -0
- package/dist/blocks/floating-menu-widget/floating-menu-widget.stories.d.ts +15 -0
- package/dist/blocks/floating-menu-widget/floating-menu-widget.stories.d.ts.map +1 -0
- package/dist/blocks/floating-menu-widget/floating-menu-widget.stories.js +22 -0
- package/dist/blocks/floating-menu-widget/index.d.ts +3 -0
- package/dist/blocks/floating-menu-widget/index.d.ts.map +1 -0
- package/dist/blocks/floating-menu-widget/index.js +1 -0
- package/dist/blocks/index.d.ts +1 -0
- package/dist/blocks/index.d.ts.map +1 -1
- package/dist/blocks/index.js +1 -0
- package/dist/components/button/button.d.ts +18 -11
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/button.js +27 -14
- package/dist/components/button/button.stories.d.ts +11 -0
- package/dist/components/button/button.stories.d.ts.map +1 -1
- package/dist/components/button/button.stories.js +84 -0
- package/dist/components/data-grid/data-grid-column-filter.d.ts +15 -0
- package/dist/components/data-grid/data-grid-column-filter.d.ts.map +1 -0
- package/dist/components/data-grid/data-grid-column-filter.js +36 -0
- package/dist/components/data-grid/data-grid-column-header.d.ts +15 -0
- package/dist/components/data-grid/data-grid-column-header.d.ts.map +1 -0
- package/dist/components/data-grid/data-grid-column-header.js +137 -0
- package/dist/components/data-grid/data-grid-column-visibility.d.ts +8 -0
- package/dist/components/data-grid/data-grid-column-visibility.d.ts.map +1 -0
- package/dist/components/data-grid/data-grid-column-visibility.js +13 -0
- package/dist/components/data-grid/data-grid-pagination.d.ts +20 -0
- package/dist/components/data-grid/data-grid-pagination.d.ts.map +1 -0
- package/dist/components/data-grid/data-grid-pagination.js +76 -0
- package/dist/components/data-grid/data-grid-scroll-area.d.ts +11 -0
- package/dist/components/data-grid/data-grid-scroll-area.d.ts.map +1 -0
- package/dist/components/data-grid/data-grid-scroll-area.js +218 -0
- package/dist/components/data-grid/data-grid-table-dnd-rows.d.ts +12 -0
- package/dist/components/data-grid/data-grid-table-dnd-rows.d.ts.map +1 -0
- package/dist/components/data-grid/data-grid-table-dnd-rows.js +91 -0
- package/dist/components/data-grid/data-grid-table-dnd.d.ts +8 -0
- package/dist/components/data-grid/data-grid-table-dnd.d.ts.map +1 -0
- package/dist/components/data-grid/data-grid-table-dnd.js +95 -0
- package/dist/components/data-grid/data-grid-table-virtual.d.ts +28 -0
- package/dist/components/data-grid/data-grid-table-virtual.d.ts.map +1 -0
- package/dist/components/data-grid/data-grid-table-virtual.js +133 -0
- package/dist/components/data-grid/data-grid-table.d.ts +98 -0
- package/dist/components/data-grid/data-grid-table.d.ts.map +1 -0
- package/dist/components/data-grid/data-grid-table.js +560 -0
- package/dist/components/data-grid/data-grid.d.ts +94 -0
- package/dist/components/data-grid/data-grid.d.ts.map +1 -0
- package/dist/components/data-grid/data-grid.js +123 -0
- package/dist/components/data-grid/data-grid.stories.d.ts +14 -0
- package/dist/components/data-grid/data-grid.stories.d.ts.map +1 -0
- package/dist/components/data-grid/data-grid.stories.js +47 -0
- package/dist/components/data-grid/index.d.ts +14 -0
- package/dist/components/data-grid/index.d.ts.map +1 -0
- package/dist/components/data-grid/index.js +10 -0
- package/dist/components/filters/filter-date-metric-value.d.ts.map +1 -1
- package/dist/components/filters/filter-date-metric-value.js +83 -8
- package/dist/components/filters/filter-fields-listing-demo.d.ts +12 -0
- package/dist/components/filters/filter-fields-listing-demo.d.ts.map +1 -0
- package/dist/components/filters/filter-fields-listing-demo.js +565 -0
- package/dist/components/filters/filters-types.d.ts +7 -0
- package/dist/components/filters/filters-types.d.ts.map +1 -1
- package/dist/components/filters/filters.stories.d.ts.map +1 -1
- package/dist/components/filters/filters.stories.js +8 -149
- package/dist/components/filters/index.d.ts +1 -0
- package/dist/components/filters/index.d.ts.map +1 -1
- package/dist/components/filters/index.js +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/popover/index.d.ts.map +1 -1
- package/dist/components/popover/index.js +1 -0
- package/dist/components/popover/popover-handle.d.ts +6 -0
- package/dist/components/popover/popover-handle.d.ts.map +1 -0
- package/dist/components/popover/popover-handle.js +6 -0
- package/dist/components/popover/popover.d.ts +41 -7
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/popover/popover.js +50 -3
- package/dist/components/progress/progress.js +1 -1
- package/dist/components/progress/progress.stories.d.ts +11 -2
- package/dist/components/progress/progress.stories.d.ts.map +1 -1
- package/dist/components/progress/progress.stories.js +77 -4
- package/dist/components/sidebar/index.d.ts +2 -0
- package/dist/components/sidebar/index.d.ts.map +1 -0
- package/dist/components/sidebar/index.js +1 -0
- package/dist/components/sidebar/sidebar.d.ts +64 -0
- package/dist/components/sidebar/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar/sidebar.js +255 -0
- package/dist/components/sidebar/sidebar.stories.d.ts +20 -0
- package/dist/components/sidebar/sidebar.stories.d.ts.map +1 -0
- package/dist/components/sidebar/sidebar.stories.js +181 -0
- package/dist/components/skeleton/index.d.ts +3 -0
- package/dist/components/skeleton/index.d.ts.map +1 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/skeleton/skeleton.d.ts +7 -0
- package/dist/components/skeleton/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton/skeleton.js +8 -0
- package/dist/components/sortable/sortable.d.ts +4 -2
- package/dist/components/sortable/sortable.d.ts.map +1 -1
- package/dist/components/sortable/sortable.js +4 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/llms.txt +1 -1
- package/package.json +7 -4
- package/src/styles/globals.css +26 -0
|
@@ -2,23 +2,12 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo, useState } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import {
|
|
5
|
+
import { BarChart3 } from 'lucide-react';
|
|
6
6
|
import { buildDateSelectorI18nFromT, DATE_SELECTOR_NAMESPACE } from '../../blocks/date-selector';
|
|
7
7
|
import { Button } from '../button';
|
|
8
8
|
import { buildFilterI18nFromT, FILTERS_NAMESPACE } from './filters-i18n.shared';
|
|
9
|
+
import { buildListingGroupedFields } from './filter-fields-listing-demo';
|
|
9
10
|
import { createFilter, DEFAULT_SUBMENU_SEARCH_MIN_OPTIONS, Filters } from '.';
|
|
10
|
-
const teamMemberOptions = [
|
|
11
|
-
{ value: 'alex', label: 'Alex Johnson' },
|
|
12
|
-
{ value: 'jamie', label: 'Jamie Lee' },
|
|
13
|
-
{ value: 'sam', label: 'Sam Rivera' },
|
|
14
|
-
{ value: 'taylor', label: 'Taylor Chen' },
|
|
15
|
-
{ value: 'jordan', label: 'Jordan Patel' },
|
|
16
|
-
{ value: 'casey', label: 'Casey Morgan' },
|
|
17
|
-
{ value: 'riley', label: 'Riley Brooks' },
|
|
18
|
-
{ value: 'quinn', label: 'Quinn Foster' },
|
|
19
|
-
{ value: 'avery', label: 'Avery Scott' },
|
|
20
|
-
{ value: 'morgan', label: 'Morgan Wells' },
|
|
21
|
-
];
|
|
22
11
|
function useFiltersStoryLocale() {
|
|
23
12
|
const { t, i18n } = useTranslation(FILTERS_NAMESPACE);
|
|
24
13
|
const filterI18n = useMemo(() => buildFilterI18nFromT(t, i18n.language), [t, i18n.language]);
|
|
@@ -28,136 +17,6 @@ function useFiltersStoryLocale() {
|
|
|
28
17
|
}, [i18n]);
|
|
29
18
|
return { t, i18n, filterI18n, dateSelectorI18n };
|
|
30
19
|
}
|
|
31
|
-
function buildDemoFields(t) {
|
|
32
|
-
return [
|
|
33
|
-
{
|
|
34
|
-
key: 'status',
|
|
35
|
-
label: t('story.fields.status', { defaultValue: 'Status' }),
|
|
36
|
-
type: 'select',
|
|
37
|
-
icon: _jsx(FilterIcon, { className: "size-4" }),
|
|
38
|
-
options: [
|
|
39
|
-
{ value: 'active', label: t('story.options.active', { defaultValue: 'Active' }) },
|
|
40
|
-
{ value: 'draft', label: t('story.options.draft', { defaultValue: 'Draft' }) },
|
|
41
|
-
],
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
key: 'name',
|
|
45
|
-
label: t('story.fields.name', { defaultValue: 'Name' }),
|
|
46
|
-
type: 'text',
|
|
47
|
-
placeholder: t('story.namePlaceholder', { defaultValue: 'Contains…' }),
|
|
48
|
-
icon: _jsx(Tag, { className: "size-4" }),
|
|
49
|
-
},
|
|
50
|
-
];
|
|
51
|
-
}
|
|
52
|
-
function buildGroupedFieldsWithSearch(t, dateSelectorI18n, i18n) {
|
|
53
|
-
return [
|
|
54
|
-
{
|
|
55
|
-
group: t('story.groups.listingFeatures', { defaultValue: 'Listing Features' }),
|
|
56
|
-
fields: [
|
|
57
|
-
{
|
|
58
|
-
key: 'propertyType',
|
|
59
|
-
label: t('story.fields.propertyType', { defaultValue: 'Property Type' }),
|
|
60
|
-
type: 'multiselect',
|
|
61
|
-
icon: _jsx(Home, { className: "size-4" }),
|
|
62
|
-
options: [
|
|
63
|
-
{ value: 'house', label: t('story.options.house', { defaultValue: 'House' }) },
|
|
64
|
-
{ value: 'condo', label: t('story.options.condo', { defaultValue: 'Condo' }) },
|
|
65
|
-
{ value: 'townhome', label: t('story.options.townhome', { defaultValue: 'Townhome' }) },
|
|
66
|
-
{ value: 'land', label: t('story.options.land', { defaultValue: 'Land' }) },
|
|
67
|
-
],
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
key: 'hasPool',
|
|
71
|
-
label: t('story.fields.hasPool', { defaultValue: 'Has Pool' }),
|
|
72
|
-
type: 'select',
|
|
73
|
-
icon: _jsx(Home, { className: "size-4" }),
|
|
74
|
-
options: [
|
|
75
|
-
{ value: 'yes', label: t('story.options.yes', { defaultValue: 'Yes' }) },
|
|
76
|
-
{ value: 'no', label: t('story.options.no', { defaultValue: 'No' }) },
|
|
77
|
-
],
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
group: t('story.groups.listingStatus', { defaultValue: 'Listing Status' }),
|
|
83
|
-
fields: [
|
|
84
|
-
{
|
|
85
|
-
key: 'listingStatus',
|
|
86
|
-
label: t('story.fields.listingStatus', { defaultValue: 'Listing Status' }),
|
|
87
|
-
type: 'multiselect',
|
|
88
|
-
icon: _jsx(Activity, { className: "size-4" }),
|
|
89
|
-
options: [
|
|
90
|
-
{ value: 'active', label: t('story.options.active', { defaultValue: 'Active' }) },
|
|
91
|
-
{ value: 'pending', label: t('story.options.pending', { defaultValue: 'Pending' }) },
|
|
92
|
-
{ value: 'sold', label: t('story.options.sold', { defaultValue: 'Sold' }) },
|
|
93
|
-
{ value: 'withdrawn', label: t('story.options.withdrawn', { defaultValue: 'Withdrawn' }) },
|
|
94
|
-
{ value: 'expired', label: t('story.options.expired', { defaultValue: 'Expired' }) },
|
|
95
|
-
],
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
group: t('story.groups.teamAccess', { defaultValue: 'Team & Access' }),
|
|
101
|
-
fields: [
|
|
102
|
-
{
|
|
103
|
-
key: 'teamMember',
|
|
104
|
-
label: t('story.fields.teamMember', { defaultValue: 'Team Member' }),
|
|
105
|
-
type: 'multiselect',
|
|
106
|
-
icon: _jsx(Users, { className: "size-4" }),
|
|
107
|
-
options: teamMemberOptions,
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
key: 'yourAccess',
|
|
111
|
-
label: t('story.fields.yourAccess', { defaultValue: 'Your Access' }),
|
|
112
|
-
type: 'select',
|
|
113
|
-
icon: _jsx(Users, { className: "size-4" }),
|
|
114
|
-
options: [
|
|
115
|
-
{ value: 'owner', label: t('story.options.owner', { defaultValue: 'Owner' }) },
|
|
116
|
-
{ value: 'editor', label: t('story.options.editor', { defaultValue: 'Editor' }) },
|
|
117
|
-
{ value: 'viewer', label: t('story.options.viewer', { defaultValue: 'Viewer' }) },
|
|
118
|
-
],
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
key: 'listingAdmin',
|
|
122
|
-
label: t('story.fields.listingAdmin', { defaultValue: 'Admin of Listing' }),
|
|
123
|
-
type: 'select',
|
|
124
|
-
icon: _jsx(Users, { className: "size-4" }),
|
|
125
|
-
options: [
|
|
126
|
-
{ value: 'me', label: t('story.options.me', { defaultValue: 'Me' }) },
|
|
127
|
-
{ value: 'broker', label: t('story.options.broker', { defaultValue: 'Broker' }) },
|
|
128
|
-
],
|
|
129
|
-
},
|
|
130
|
-
],
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
group: t('story.groups.listingPerformance', { defaultValue: 'Listing Performance' }),
|
|
134
|
-
fields: [
|
|
135
|
-
{
|
|
136
|
-
key: 'adjRevpar',
|
|
137
|
-
label: t('story.fields.adjRevpar', { defaultValue: 'Adj. RevPAR' }),
|
|
138
|
-
type: 'date_metric',
|
|
139
|
-
icon: _jsx(BarChart3, { className: "size-4" }),
|
|
140
|
-
dateMetricProps: {
|
|
141
|
-
showRollingPresets: true,
|
|
142
|
-
i18nInstance: i18n,
|
|
143
|
-
i18n: dateSelectorI18n,
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
key: 'performanceTier',
|
|
148
|
-
label: t('story.fields.performanceTier', { defaultValue: 'Performance Tier' }),
|
|
149
|
-
type: 'select',
|
|
150
|
-
icon: _jsx(BarChart3, { className: "size-4" }),
|
|
151
|
-
options: [
|
|
152
|
-
{ value: 'top', label: t('story.options.top', { defaultValue: 'Top quartile' }) },
|
|
153
|
-
{ value: 'mid', label: t('story.options.mid', { defaultValue: 'Mid' }) },
|
|
154
|
-
{ value: 'low', label: t('story.options.low', { defaultValue: 'Needs attention' }) },
|
|
155
|
-
],
|
|
156
|
-
},
|
|
157
|
-
],
|
|
158
|
-
},
|
|
159
|
-
];
|
|
160
|
-
}
|
|
161
20
|
const FILTER_PLAYGROUND_KEYS = [
|
|
162
21
|
'className',
|
|
163
22
|
'size',
|
|
@@ -235,14 +94,14 @@ function addFilterTriggerButtonLabel(size, label) {
|
|
|
235
94
|
}
|
|
236
95
|
function FiltersStoryHost(playground) {
|
|
237
96
|
const [filters, setFilters] = useState([]);
|
|
238
|
-
const { t, filterI18n } = useFiltersStoryLocale();
|
|
239
|
-
const fields = useMemo(() =>
|
|
97
|
+
const { t, i18n, filterI18n, dateSelectorI18n } = useFiltersStoryLocale();
|
|
98
|
+
const fields = useMemo(() => buildListingGroupedFields(t, dateSelectorI18n, i18n), [t, dateSelectorI18n, i18n]);
|
|
240
99
|
return (_jsx("div", { className: "flex min-h-32 min-w-[min(100%,28rem)] flex-wrap items-start gap-2 p-4", children: _jsx(Filters, { filters: filters, fields: fields, onChange: setFilters, i18n: filterI18n, trigger: addFilterTriggerButtonLabel(playground.size, filterI18n.addFilterTitle), ...playground }) }));
|
|
241
100
|
}
|
|
242
101
|
function FiltersWithInitialStateHost(playground) {
|
|
243
|
-
const [filters, setFilters] = useState(() => [createFilter('
|
|
244
|
-
const { t, filterI18n } = useFiltersStoryLocale();
|
|
245
|
-
const fields = useMemo(() =>
|
|
102
|
+
const [filters, setFilters] = useState(() => [createFilter('is_active', 'is', ['active'])]);
|
|
103
|
+
const { t, i18n, filterI18n, dateSelectorI18n } = useFiltersStoryLocale();
|
|
104
|
+
const fields = useMemo(() => buildListingGroupedFields(t, dateSelectorI18n, i18n), [t, dateSelectorI18n, i18n]);
|
|
246
105
|
return (_jsx("div", { className: "flex min-h-32 min-w-[min(100%,28rem)] flex-wrap items-start gap-2 p-4", children: _jsx(Filters, { filters: filters, fields: fields, onChange: setFilters, i18n: filterI18n, trigger: addFilterTriggerButtonLabel(playground.size, filterI18n.addFilterTitle), ...playground }) }));
|
|
247
106
|
}
|
|
248
107
|
const meta = {
|
|
@@ -285,7 +144,7 @@ function FiltersGroupedAndSearchHost(props) {
|
|
|
285
144
|
const { groupedMenuMode, defaultAddFilterGroupsCollapsed, ...raw } = props;
|
|
286
145
|
const { nestedAddFilterGroups: _omitNested, collapsibleAddFilterGroups: _omitCollapsible, defaultAddFilterGroupsCollapsed: _omitDefaultCollapsed, ...playground } = pickFiltersPlaygroundArgs(raw);
|
|
287
146
|
const { t, i18n, filterI18n, dateSelectorI18n } = useFiltersStoryLocale();
|
|
288
|
-
const groupedFieldsWithSearch = useMemo(() =>
|
|
147
|
+
const groupedFieldsWithSearch = useMemo(() => buildListingGroupedFields(t, dateSelectorI18n, i18n), [t, dateSelectorI18n, i18n]);
|
|
289
148
|
const groupedI18n = useMemo(() => ({
|
|
290
149
|
...filterI18n,
|
|
291
150
|
searchFields: t('story.searchFieldsGrouped', { defaultValue: 'Filter by…' }),
|
|
@@ -3,5 +3,6 @@ export * from './filters-i18n.shared';
|
|
|
3
3
|
export * from './filters-types';
|
|
4
4
|
export * from './filters-utils';
|
|
5
5
|
export { dateSegmentLabelForBar, FilterDateMetricBarPeriodSegments, FilterDateMetricBarValueSegment } from './filter-date-metric-value';
|
|
6
|
+
export { buildListingDemoFields, buildListingDemoFieldsForDocs, buildListingGroupedFields, buildListingGroupedFieldsForDocs, } from './filter-fields-listing-demo';
|
|
6
7
|
export { DEFAULT_SUBMENU_SEARCH_MIN_OPTIONS, Filters, FiltersContent } from './filters';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/filters/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,sBAAsB,EAAE,iCAAiC,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AACxI,OAAO,EAAE,kCAAkC,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/filters/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,sBAAsB,EAAE,iCAAiC,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AACxI,OAAO,EACH,sBAAsB,EACtB,6BAA6B,EAC7B,yBAAyB,EACzB,gCAAgC,GACnC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,kCAAkC,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -3,4 +3,5 @@ export * from './filters-i18n.shared';
|
|
|
3
3
|
export * from './filters-types';
|
|
4
4
|
export * from './filters-utils';
|
|
5
5
|
export { dateSegmentLabelForBar, FilterDateMetricBarPeriodSegments, FilterDateMetricBarValueSegment } from './filter-date-metric-value';
|
|
6
|
+
export { buildListingDemoFields, buildListingDemoFieldsForDocs, buildListingGroupedFields, buildListingGroupedFieldsForDocs, } from './filter-fields-listing-demo';
|
|
6
7
|
export { DEFAULT_SUBMENU_SEARCH_MIN_OPTIONS, Filters, FiltersContent } from './filters';
|
|
@@ -14,6 +14,7 @@ export * from './collapsible';
|
|
|
14
14
|
export * from './command';
|
|
15
15
|
export * from './combobox';
|
|
16
16
|
export * from './context-menu';
|
|
17
|
+
export * from './data-grid';
|
|
17
18
|
export * from './dialog';
|
|
18
19
|
export * from './direction';
|
|
19
20
|
export * from './drawer';
|
|
@@ -40,6 +41,8 @@ export * from './scroll-area';
|
|
|
40
41
|
export * from './separator';
|
|
41
42
|
export * from './select';
|
|
42
43
|
export * from './sheet';
|
|
44
|
+
export * from './sidebar';
|
|
45
|
+
export * from './skeleton';
|
|
43
46
|
export * from './slider';
|
|
44
47
|
export * from './sonner';
|
|
45
48
|
export * from './sortable';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AAC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AC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -14,6 +14,7 @@ export * from './collapsible';
|
|
|
14
14
|
export * from './command';
|
|
15
15
|
export * from './combobox';
|
|
16
16
|
export * from './context-menu';
|
|
17
|
+
export * from './data-grid';
|
|
17
18
|
export * from './dialog';
|
|
18
19
|
export * from './direction';
|
|
19
20
|
export * from './drawer';
|
|
@@ -40,6 +41,8 @@ export * from './scroll-area';
|
|
|
40
41
|
export * from './separator';
|
|
41
42
|
export * from './select';
|
|
42
43
|
export * from './sheet';
|
|
44
|
+
export * from './sidebar';
|
|
45
|
+
export * from './skeleton';
|
|
43
46
|
export * from './slider';
|
|
44
47
|
export * from './sonner';
|
|
45
48
|
export * from './sortable';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/popover/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/popover/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Popover as PopoverPrimitive } from '@base-ui/react/popover';
|
|
2
|
+
/** @see [Base UI Popover — createHandle](https://base-ui.com/react/components/popover) */
|
|
3
|
+
export declare const createPopoverHandle: typeof PopoverPrimitive.createHandle;
|
|
4
|
+
/** @see [Base UI Popover — Handle](https://base-ui.com/react/components/popover) */
|
|
5
|
+
export declare const PopoverHandle: typeof PopoverPrimitive.Handle;
|
|
6
|
+
//# sourceMappingURL=popover-handle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover-handle.d.ts","sourceRoot":"","sources":["../../../src/components/popover/popover-handle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAErE,0FAA0F;AAC1F,eAAO,MAAM,mBAAmB,sCAAgC,CAAC;AAEjE,oFAAoF;AACpF,eAAO,MAAM,aAAa,gCAA0B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Popover as PopoverPrimitive } from '@base-ui/react/popover';
|
|
3
|
+
/** @see [Base UI Popover — createHandle](https://base-ui.com/react/components/popover) */
|
|
4
|
+
export const createPopoverHandle = PopoverPrimitive.createHandle;
|
|
5
|
+
/** @see [Base UI Popover — Handle](https://base-ui.com/react/components/popover) */
|
|
6
|
+
export const PopoverHandle = PopoverPrimitive.Handle;
|
|
@@ -1,20 +1,54 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Popover as PopoverPrimitive } from '@base-ui/react/popover';
|
|
3
|
-
type
|
|
4
|
-
/**
|
|
3
|
+
type PositionerFieldsOmittedFromPopup = Pick<PopoverPrimitive.Positioner.Props, 'anchor' | 'side' | 'sideOffset' | 'align' | 'alignOffset' | 'positionMethod' | 'collisionBoundary' | 'collisionPadding' | 'sticky' | 'arrowPadding' | 'disableAnchorTracking' | 'collisionAvoidance'>;
|
|
4
|
+
/** @see [Base UI Popover — Root](https://base-ui.com/react/components/popover) */
|
|
5
5
|
export type PopoverProps = PopoverPrimitive.Root.Props;
|
|
6
6
|
declare function Popover({ ...props }: PopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
/**
|
|
7
|
+
/** @see [Base UI Popover — Trigger](https://base-ui.com/react/components/popover) */
|
|
8
8
|
export type PopoverTriggerProps = PopoverPrimitive.Trigger.Props;
|
|
9
9
|
declare function PopoverTrigger({ ...props }: PopoverTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
/**
|
|
11
|
-
export type
|
|
12
|
-
declare function
|
|
10
|
+
/** @see [Base UI Popover — Portal](https://base-ui.com/react/components/popover) */
|
|
11
|
+
export type PopoverPortalProps = PopoverPrimitive.Portal.Props;
|
|
12
|
+
declare function PopoverPortal({ ...props }: PopoverPortalProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
/** @see [Base UI Popover — Positioner](https://base-ui.com/react/components/popover) */
|
|
14
|
+
export type PopoverPositionerProps = PopoverPrimitive.Positioner.Props;
|
|
15
|
+
declare function PopoverPositioner({ className, ...props }: PopoverPrimitive.Positioner.Props): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
/** @see [Base UI Popover — Popup](https://base-ui.com/react/components/popover) */
|
|
17
|
+
export type PopoverPopupProps = PopoverPrimitive.Popup.Props;
|
|
18
|
+
declare function PopoverPopup({ className, ...props }: PopoverPrimitive.Popup.Props): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
/** @see [Base UI Popover — Arrow](https://base-ui.com/react/components/popover) */
|
|
20
|
+
export type PopoverArrowProps = PopoverPrimitive.Arrow.Props;
|
|
21
|
+
declare function PopoverArrow({ ...props }: PopoverArrowProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
/** @see [Base UI Popover — Backdrop](https://base-ui.com/react/components/popover) */
|
|
23
|
+
export type PopoverBackdropProps = PopoverPrimitive.Backdrop.Props;
|
|
24
|
+
declare function PopoverBackdrop({ ...props }: PopoverBackdropProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
/** @see [Base UI Popover — Close](https://base-ui.com/react/components/popover) */
|
|
26
|
+
export type PopoverCloseProps = PopoverPrimitive.Close.Props;
|
|
27
|
+
declare function PopoverClose({ ...props }: PopoverCloseProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
/** @see [Base UI Popover — Viewport](https://base-ui.com/react/components/popover) */
|
|
29
|
+
export type PopoverViewportProps = PopoverPrimitive.Viewport.Props;
|
|
30
|
+
declare function PopoverViewport({ ...props }: PopoverViewportProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
/**
|
|
32
|
+
* Shorthand: `Portal` → `Positioner` → `Popup` with design-system surface styles on the popup.
|
|
33
|
+
* Pass any `Popover.Popup` prop; positioning props (`anchor`, `side`, …) are forwarded to `Positioner`.
|
|
34
|
+
* Use `positionerProps` / `portalProps` / `positionerClassName` for full control.
|
|
35
|
+
*/
|
|
36
|
+
export type PopoverContentProps = Omit<PopoverPrimitive.Popup.Props, keyof PositionerFieldsOmittedFromPopup> & Partial<PositionerFieldsOmittedFromPopup> & {
|
|
37
|
+
portalProps?: Omit<PopoverPrimitive.Portal.Props, 'children'>;
|
|
38
|
+
positionerProps?: Partial<PopoverPrimitive.Positioner.Props>;
|
|
39
|
+
/** Merged into `Popover.Positioner` after defaults (`isolate z-50`). */
|
|
40
|
+
positionerClassName?: string;
|
|
41
|
+
/** Forwarded to `Popover.Portal` (can also be set inside `portalProps`). */
|
|
42
|
+
keepMounted?: PopoverPrimitive.Portal.Props['keepMounted'];
|
|
43
|
+
};
|
|
44
|
+
declare function PopoverContent({ portalProps, positionerProps, positionerClassName, keepMounted, className, children, ...rest }: PopoverContentProps): import("react/jsx-runtime").JSX.Element;
|
|
13
45
|
export type PopoverHeaderProps = React.ComponentProps<'div'>;
|
|
14
46
|
declare function PopoverHeader({ className, ...props }: PopoverHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
/** @see [Base UI Popover — Title](https://base-ui.com/react/components/popover) */
|
|
15
48
|
export type PopoverTitleProps = PopoverPrimitive.Title.Props;
|
|
16
49
|
declare function PopoverTitle({ className, ...props }: PopoverTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
/** @see [Base UI Popover — Description](https://base-ui.com/react/components/popover) */
|
|
17
51
|
export type PopoverDescriptionProps = PopoverPrimitive.Description.Props;
|
|
18
52
|
declare function PopoverDescription({ className, ...props }: PopoverDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export { Popover,
|
|
53
|
+
export { Popover, PopoverTrigger, PopoverPortal, PopoverPositioner, PopoverPopup, PopoverArrow, PopoverBackdrop, PopoverClose, PopoverViewport, PopoverContent, PopoverHeader, PopoverTitle, PopoverDescription, };
|
|
20
54
|
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/components/popover/popover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,O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C9D,CAAC;AAEN,iBAAS,cAAc,CAAC,EAAE,WAAW,EAAE,eAAe,EAAE,mBAAmB,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,mBAAmB,2CA2B5I;AAED,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAE7D,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,2CAEjE;AAED,mFAAmF;AACnF,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC;AAE7D,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,2CAE/D;AAED,yFAAyF;AACzF,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,CAAC,WAAW,CAAC,KAAK,CAAC;AAEzE,iBAAS,kBAAkB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,uBAAuB,2CAE3E;AAED,OAAO,EACH,OAAO,EACP,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,eAAe,EACf,cAAc,EACd,aAAa,EACb,YAAY,EACZ,kBAAkB,GACrB,CAAC"}
|
|
@@ -3,14 +3,61 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { Popover as PopoverPrimitive } from '@base-ui/react/popover';
|
|
5
5
|
import { cn } from '../../lib/utils';
|
|
6
|
+
const POPUP_SURFACE_CLASS = 'z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95';
|
|
7
|
+
/** Keys handled by `Popover.Positioner` when passed to `PopoverContent` (remaining props go to `Popover.Popup`). */
|
|
8
|
+
const POPOVER_CONTENT_POSITIONER_KEYS = new Set([
|
|
9
|
+
'anchor',
|
|
10
|
+
'side',
|
|
11
|
+
'sideOffset',
|
|
12
|
+
'align',
|
|
13
|
+
'alignOffset',
|
|
14
|
+
'positionMethod',
|
|
15
|
+
'collisionBoundary',
|
|
16
|
+
'collisionPadding',
|
|
17
|
+
'sticky',
|
|
18
|
+
'arrowPadding',
|
|
19
|
+
'disableAnchorTracking',
|
|
20
|
+
'collisionAvoidance',
|
|
21
|
+
]);
|
|
6
22
|
function Popover({ ...props }) {
|
|
7
23
|
return _jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
8
24
|
}
|
|
9
25
|
function PopoverTrigger({ ...props }) {
|
|
10
26
|
return _jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
11
27
|
}
|
|
12
|
-
function
|
|
13
|
-
return
|
|
28
|
+
function PopoverPortal({ ...props }) {
|
|
29
|
+
return _jsx(PopoverPrimitive.Portal, { "data-slot": "popover-portal", ...props });
|
|
30
|
+
}
|
|
31
|
+
function PopoverPositioner({ className, ...props }) {
|
|
32
|
+
return _jsx(PopoverPrimitive.Positioner, { className: cn('isolate z-50', className), "data-slot": "popover-positioner", ...props });
|
|
33
|
+
}
|
|
34
|
+
function PopoverPopup({ className, ...props }) {
|
|
35
|
+
return _jsx(PopoverPrimitive.Popup, { className: cn(POPUP_SURFACE_CLASS, className), "data-slot": "popover-popup", ...props });
|
|
36
|
+
}
|
|
37
|
+
function PopoverArrow({ ...props }) {
|
|
38
|
+
return _jsx(PopoverPrimitive.Arrow, { "data-slot": "popover-arrow", ...props });
|
|
39
|
+
}
|
|
40
|
+
function PopoverBackdrop({ ...props }) {
|
|
41
|
+
return _jsx(PopoverPrimitive.Backdrop, { "data-slot": "popover-backdrop", ...props });
|
|
42
|
+
}
|
|
43
|
+
function PopoverClose({ ...props }) {
|
|
44
|
+
return _jsx(PopoverPrimitive.Close, { "data-slot": "popover-close", ...props });
|
|
45
|
+
}
|
|
46
|
+
function PopoverViewport({ ...props }) {
|
|
47
|
+
return _jsx(PopoverPrimitive.Viewport, { "data-slot": "popover-viewport", ...props });
|
|
48
|
+
}
|
|
49
|
+
function PopoverContent({ portalProps, positionerProps, positionerClassName, keepMounted, className, children, ...rest }) {
|
|
50
|
+
const positionerBag = {};
|
|
51
|
+
const popupBag = { ...rest };
|
|
52
|
+
for (const key of POPOVER_CONTENT_POSITIONER_KEYS) {
|
|
53
|
+
if (key in popupBag) {
|
|
54
|
+
positionerBag[key] = popupBag[key];
|
|
55
|
+
delete popupBag[key];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const { keepMounted: keepMountedPortal, ...restPortal } = portalProps ?? {};
|
|
59
|
+
const mergedKeepMounted = keepMounted ?? keepMountedPortal;
|
|
60
|
+
return (_jsx(PopoverPrimitive.Portal, { keepMounted: mergedKeepMounted, ...restPortal, children: _jsx(PopoverPrimitive.Positioner, { ...positionerBag, ...positionerProps, className: cn('isolate z-50', positionerClassName, positionerProps?.className), children: _jsx(PopoverPrimitive.Popup, { className: cn(POPUP_SURFACE_CLASS, className), ...popupBag, children: children }) }) }));
|
|
14
61
|
}
|
|
15
62
|
function PopoverHeader({ className, ...props }) {
|
|
16
63
|
return _jsx("div", { "data-slot": "popover-header", className: cn('flex flex-col gap-0.5 text-sm', className), ...props });
|
|
@@ -21,4 +68,4 @@ function PopoverTitle({ className, ...props }) {
|
|
|
21
68
|
function PopoverDescription({ className, ...props }) {
|
|
22
69
|
return _jsx(PopoverPrimitive.Description, { "data-slot": "popover-description", className: cn('text-muted-foreground', className), ...props });
|
|
23
70
|
}
|
|
24
|
-
export { Popover,
|
|
71
|
+
export { Popover, PopoverTrigger, PopoverPortal, PopoverPositioner, PopoverPopup, PopoverArrow, PopoverBackdrop, PopoverClose, PopoverViewport, PopoverContent, PopoverHeader, PopoverTitle, PopoverDescription, };
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { Progress as ProgressPrimitive } from '@base-ui/react/progress';
|
|
4
4
|
import { cn } from '../../lib/utils';
|
|
5
5
|
function Progress({ className, children, value, ...props }) {
|
|
6
|
-
return (_jsxs(ProgressPrimitive.Root, { value: value, "data-slot": "progress", className: cn('flex flex-wrap gap-
|
|
6
|
+
return (_jsxs(ProgressPrimitive.Root, { value: value, "data-slot": "progress", className: cn('flex w-full min-w-0 flex-wrap gap-1.5', className), ...props, children: [children, _jsx(ProgressTrack, { children: _jsx(ProgressIndicator, {}) })] }));
|
|
7
7
|
}
|
|
8
8
|
function ProgressTrack({ className, ...props }) {
|
|
9
9
|
return (_jsx(ProgressPrimitive.Track, { className: cn('relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted', className), "data-slot": "progress-track", ...props }));
|
|
@@ -3,7 +3,16 @@ import { Progress } from './progress';
|
|
|
3
3
|
declare const meta: Meta<typeof Progress>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
|
-
|
|
7
|
-
export declare const
|
|
6
|
+
/** Mirrors [ReUI — Basic progress](https://reui.io/components/progress). */
|
|
7
|
+
export declare const BasicProgress: Story;
|
|
8
|
+
/** Thinner track via `className` on the root (no `size` prop on the component). */
|
|
9
|
+
export declare const SmallProgress: Story;
|
|
10
|
+
export declare const LargeProgress: Story;
|
|
11
|
+
export declare const StatusMessages: Story;
|
|
12
|
+
export declare const FileUploadList: Story;
|
|
13
|
+
export declare const WithSlider: Story;
|
|
14
|
+
export declare const MultiStep: Story;
|
|
15
|
+
/** `value={null}` — animated indeterminate state (not one of the eight ReUI gallery titles, but part of the component API). */
|
|
8
16
|
export declare const Indeterminate: Story;
|
|
17
|
+
export declare const CustomColors: Story;
|
|
9
18
|
//# sourceMappingURL=progress.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.stories.d.ts","sourceRoot":"","sources":["../../../src/components/progress/progress.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"progress.stories.d.ts","sourceRoot":"","sources":["../../../src/components/progress/progress.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAE,QAAQ,EAAgC,MAAM,YAAY,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,CAc/B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,4EAA4E;AAC5E,eAAO,MAAM,aAAa,EAAE,KAM3B,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,aAAa,EAAE,KAO3B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAO3B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAa5B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAgC5B,CAAC;AA2BF,eAAO,MAAM,UAAU,EAAE,KAGxB,CAAC;AAkDF,eAAO,MAAM,SAAS,EAAE,KAGvB,CAAC;AAEF,+HAA+H;AAC/H,eAAO,MAAM,aAAa,EAAE,KAK3B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAwB1B,CAAC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '../card';
|
|
4
|
+
import { Label } from '../label';
|
|
5
|
+
import { Slider } from '../slider';
|
|
2
6
|
import { Progress, ProgressLabel, ProgressValue } from './progress';
|
|
7
|
+
import { cn } from '../../lib/utils';
|
|
3
8
|
const meta = {
|
|
4
9
|
title: 'Components/Progress',
|
|
5
10
|
component: Progress,
|
|
@@ -8,22 +13,90 @@ const meta = {
|
|
|
8
13
|
layout: 'centered',
|
|
9
14
|
},
|
|
10
15
|
decorators: [
|
|
11
|
-
(Story) => (_jsx("div", { className: "flex w-full max-w-
|
|
16
|
+
(Story) => (_jsx("div", { className: "mx-auto flex w-full max-w-md min-w-80 flex-col gap-4 px-4", children: _jsx(Story, {}) })),
|
|
12
17
|
],
|
|
13
18
|
};
|
|
14
19
|
export default meta;
|
|
15
|
-
|
|
20
|
+
/** Mirrors [ReUI — Basic progress](https://reui.io/components/progress). */
|
|
21
|
+
export const BasicProgress = {
|
|
22
|
+
name: 'Basic progress',
|
|
16
23
|
args: {
|
|
17
24
|
value: 45,
|
|
18
25
|
'aria-label': 'Progress',
|
|
19
26
|
},
|
|
20
27
|
};
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
/** Thinner track via `className` on the root (no `size` prop on the component). */
|
|
29
|
+
export const SmallProgress = {
|
|
30
|
+
name: 'Small progress',
|
|
31
|
+
args: {
|
|
32
|
+
value: 62,
|
|
33
|
+
'aria-label': 'Progress',
|
|
34
|
+
className: '[&_[data-slot=progress-track]]:h-0.5',
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
export const LargeProgress = {
|
|
38
|
+
name: 'Large progress',
|
|
39
|
+
args: {
|
|
40
|
+
value: 38,
|
|
41
|
+
'aria-label': 'Progress',
|
|
42
|
+
className: '[&_[data-slot=progress-track]]:h-2.5',
|
|
43
|
+
},
|
|
23
44
|
};
|
|
45
|
+
export const StatusMessages = {
|
|
46
|
+
name: 'Progress bar with status messages',
|
|
47
|
+
render: () => (_jsx(Progress, { value: 68, children: _jsxs("div", { className: "flex w-full min-w-0 flex-col gap-1", children: [_jsxs("div", { className: "flex w-full min-w-0 items-center gap-2", children: [_jsx(ProgressLabel, { children: "Deploying" }), _jsx(ProgressValue, {})] }), _jsx("p", { className: "text-xs text-muted-foreground", children: "Build finished \u2014 uploading assets to the CDN\u2026" })] }) })),
|
|
48
|
+
};
|
|
49
|
+
export const FileUploadList = {
|
|
50
|
+
name: 'File upload list with progress & status',
|
|
51
|
+
render: () => {
|
|
52
|
+
const files = [
|
|
53
|
+
{ name: 'report.pdf', value: 100, status: 'Complete' },
|
|
54
|
+
{ name: 'screenshot.png', value: 72, status: 'Uploading' },
|
|
55
|
+
{ name: 'archive.zip', value: 14, status: 'Queued' },
|
|
56
|
+
];
|
|
57
|
+
return (_jsxs(Card, { size: "sm", children: [_jsxs(CardHeader, { className: "pb-0", children: [_jsx(CardTitle, { children: "Uploads" }), _jsx(CardDescription, { children: "3 files \u00B7 2.4 MB total" })] }), _jsx(CardContent, { className: "flex flex-col gap-2", children: files.map((file) => (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsxs("div", { className: "flex min-w-0 items-baseline justify-between gap-2 text-sm", children: [_jsx("span", { className: "truncate font-medium", children: file.name }), _jsx("span", { className: "shrink-0 text-muted-foreground tabular-nums", children: file.status })] }), _jsx(Progress, { value: file.value, "aria-label": `${file.name} upload progress`, className: "gap-2 [&_[data-slot=progress-track]]:h-1", children: _jsxs("span", { className: "sr-only", children: [file.name, ": ", file.value, "% complete"] }) })] }, file.name))) })] }));
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
function ProgressWithSliderDemo() {
|
|
61
|
+
const [value, setValue] = useState(40);
|
|
62
|
+
return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(Progress, { value: value, "aria-labelledby": "progress-with-slider-label", children: _jsxs("div", { className: "flex w-full min-w-0 items-center", children: [_jsx(ProgressLabel, { id: "progress-with-slider-label", children: "Completion" }), _jsx(ProgressValue, {})] }) }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(Label, { htmlFor: "progress-slider-control", children: "Adjust value" }), _jsx(Slider, { id: "progress-slider-control", value: value, onValueChange: (v) => setValue(typeof v === 'number' ? v : (v[0] ?? 0)), min: 0, max: 100, "aria-valuetext": `${value} percent` })] })] }));
|
|
63
|
+
}
|
|
64
|
+
export const WithSlider = {
|
|
65
|
+
name: 'Progress bar with slider',
|
|
66
|
+
render: () => _jsx(ProgressWithSliderDemo, {}),
|
|
67
|
+
};
|
|
68
|
+
function MultiStepDemo() {
|
|
69
|
+
const total = 4;
|
|
70
|
+
const [current, setCurrent] = useState(1);
|
|
71
|
+
const pct = Math.round(((current - 1) / (total - 1)) * 100);
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
const id = window.setInterval(() => {
|
|
74
|
+
setCurrent((step) => (step >= total ? 1 : step + 1));
|
|
75
|
+
}, 2200);
|
|
76
|
+
return () => window.clearInterval(id);
|
|
77
|
+
}, []);
|
|
78
|
+
return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx("ol", { className: "flex w-full list-none items-center gap-1 p-0", "aria-label": "Onboarding steps", children: Array.from({ length: total }, (_, i) => {
|
|
79
|
+
const step = i + 1;
|
|
80
|
+
const state = step < current ? 'complete' : step === current ? 'current' : 'upcoming';
|
|
81
|
+
return (_jsxs("li", { className: cn('flex min-w-0 items-center gap-1', step !== 1 ? 'flex-1' : ''), children: [i > 0 ? _jsx("span", { className: "h-px min-w-2 flex-1 bg-border", "aria-hidden": true }) : null, _jsx("span", { className: state === 'complete'
|
|
82
|
+
? 'flex size-8 shrink-0 items-center justify-center rounded-full bg-primary text-xs font-medium text-primary-foreground'
|
|
83
|
+
: state === 'current'
|
|
84
|
+
? 'flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/15 text-xs font-medium text-primary ring-2 ring-primary ring-offset-2 ring-offset-background'
|
|
85
|
+
: 'flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium text-muted-foreground', children: state === 'complete' ? '✓' : step })] }, step));
|
|
86
|
+
}) }), _jsx(Progress, { value: pct, "aria-label": `Step ${current} of ${total}`, children: _jsxs("div", { className: "flex w-full min-w-0 items-center gap-2", children: [_jsxs(ProgressLabel, { children: ["Step ", current, " of ", total] }), _jsx(ProgressValue, {})] }) })] }));
|
|
87
|
+
}
|
|
88
|
+
export const MultiStep = {
|
|
89
|
+
name: 'Multi-step progress indicator',
|
|
90
|
+
render: () => _jsx(MultiStepDemo, {}),
|
|
91
|
+
};
|
|
92
|
+
/** `value={null}` — animated indeterminate state (not one of the eight ReUI gallery titles, but part of the component API). */
|
|
24
93
|
export const Indeterminate = {
|
|
25
94
|
args: {
|
|
26
95
|
value: null,
|
|
27
96
|
'aria-label': 'Loading',
|
|
28
97
|
},
|
|
29
98
|
};
|
|
99
|
+
export const CustomColors = {
|
|
100
|
+
name: 'Progress bar with custom colors',
|
|
101
|
+
render: () => (_jsxs("div", { className: "flex flex-col gap-3", children: [_jsx(Progress, { value: 80, "aria-label": "Storage used", className: "[&_[data-slot=progress-indicator]]:bg-emerald-600", children: _jsxs("div", { className: "flex w-full min-w-0 items-center gap-2", children: [_jsx(ProgressLabel, { children: "Storage" }), _jsx(ProgressValue, {})] }) }), _jsx(Progress, { value: 45, "aria-label": "API quota", className: "[&_[data-slot=progress-indicator]]:bg-amber-500", children: _jsxs("div", { className: "flex w-full min-w-0 items-center gap-2", children: [_jsx(ProgressLabel, { children: "API quota" }), _jsx(ProgressValue, {})] }) }), _jsx(Progress, { value: 92, "aria-label": "Error budget", className: "[&_[data-slot=progress-indicator]]:bg-destructive", children: _jsxs("div", { className: "flex w-full min-w-0 items-center gap-2", children: [_jsx(ProgressLabel, { children: "Error budget" }), _jsx(ProgressValue, {})] }) })] })),
|
|
102
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sidebar';
|