@adea-ai/ui 0.84.0 → 0.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -1
- package/dist/NOTICE +60 -0
- package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
- package/dist/components/composites/action-button/action-button.js +2 -2
- package/dist/components/composites/action-button/action-button.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser-group.d.ts +20 -0
- package/dist/components/composites/catalog-browser/catalog-browser-group.d.ts.map +1 -0
- package/dist/components/composites/catalog-browser/catalog-browser-group.js +195 -0
- package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -0
- package/dist/components/composites/catalog-browser/catalog-browser.d.ts +3 -0
- package/dist/components/composites/catalog-browser/catalog-browser.d.ts.map +1 -0
- package/dist/components/composites/catalog-browser/catalog-browser.js +378 -0
- package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -0
- package/dist/components/composites/catalog-browser/catalog-detail.d.ts +21 -0
- package/dist/components/composites/catalog-browser/catalog-detail.d.ts.map +1 -0
- package/dist/components/composites/catalog-browser/catalog-detail.js +92 -0
- package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -0
- package/dist/components/composites/catalog-browser/catalog-types.d.ts +78 -0
- package/dist/components/composites/catalog-browser/catalog-types.d.ts.map +1 -0
- package/dist/components/composites/catalog-browser/index.d.ts +4 -0
- package/dist/components/composites/catalog-browser/index.d.ts.map +1 -0
- package/dist/components/composites/catalog-browser/index.js +3 -0
- package/dist/components/composites/list-row/list-row.d.ts +6 -3
- package/dist/components/composites/list-row/list-row.d.ts.map +1 -1
- package/dist/components/composites/list-row/list-row.js +69 -7
- package/dist/components/composites/list-row/list-row.js.map +1 -1
- package/dist/components/composites/settings/settings.d.ts +9 -11
- package/dist/components/composites/settings/settings.d.ts.map +1 -1
- package/dist/components/composites/settings/settings.js +48 -33
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/conversation/message-composer.js +1 -1
- package/dist/components/conversation/scroll-follow.d.ts.map +1 -1
- package/dist/components/conversation/scroll-follow.js +95 -15
- package/dist/components/conversation/scroll-follow.js.map +1 -1
- package/dist/components/layout/app-shell/index.d.ts +1 -0
- package/dist/components/layout/app-shell/index.d.ts.map +1 -1
- package/dist/components/layout/app-shell/index.js +2 -1
- package/dist/components/layout/app-shell/skip-link.d.ts +11 -0
- package/dist/components/layout/app-shell/skip-link.d.ts.map +1 -0
- package/dist/components/layout/app-shell/skip-link.js +44 -0
- package/dist/components/layout/app-shell/skip-link.js.map +1 -0
- package/dist/components/layout/floating-preview/floating-preview.d.ts +12 -0
- package/dist/components/layout/floating-preview/floating-preview.d.ts.map +1 -0
- package/dist/components/layout/floating-preview/floating-preview.js +283 -0
- package/dist/components/layout/floating-preview/floating-preview.js.map +1 -0
- package/dist/components/layout/floating-preview/index.d.ts +3 -0
- package/dist/components/layout/floating-preview/index.d.ts.map +1 -0
- package/dist/components/layout/floating-preview/index.js +3 -0
- package/dist/components/layout/floating-preview/model.d.ts +74 -0
- package/dist/components/layout/floating-preview/model.d.ts.map +1 -0
- package/dist/components/layout/floating-preview/model.js +146 -0
- package/dist/components/layout/floating-preview/model.js.map +1 -0
- package/dist/components/theme/index.d.ts +1 -0
- package/dist/components/theme/index.d.ts.map +1 -1
- package/dist/components/theme/index.js +2 -1
- package/dist/components/theme/theme-mode-toggle.d.ts +10 -0
- package/dist/components/theme/theme-mode-toggle.d.ts.map +1 -0
- package/dist/components/theme/theme-mode-toggle.js +82 -0
- package/dist/components/theme/theme-mode-toggle.js.map +1 -0
- package/dist/components/ui/checkbox/checkbox.d.ts +2 -0
- package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js +24 -3
- package/dist/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox/combobox.js +41 -4
- package/dist/components/ui/combobox/combobox.js.map +1 -1
- package/dist/components/ui/combobox/index.d.ts +1 -0
- package/dist/components/ui/combobox/index.d.ts.map +1 -1
- package/dist/components/ui/combobox/index.js +2 -1
- package/dist/components/ui/combobox/value-combobox.d.ts +19 -0
- package/dist/components/ui/combobox/value-combobox.d.ts.map +1 -0
- package/dist/components/ui/combobox/value-combobox.js +42 -0
- package/dist/components/ui/combobox/value-combobox.js.map +1 -0
- package/dist/components/ui/empty/empty-state.d.ts +15 -0
- package/dist/components/ui/empty/empty-state.d.ts.map +1 -0
- package/dist/components/ui/empty/empty-state.js +96 -0
- package/dist/components/ui/empty/empty-state.js.map +1 -0
- package/dist/components/ui/empty/index.d.ts +1 -0
- package/dist/components/ui/empty/index.d.ts.map +1 -1
- package/dist/components/ui/empty/index.js +2 -1
- package/dist/components/ui/entity-icon/entity-icon.d.ts +4 -1
- package/dist/components/ui/entity-icon/entity-icon.d.ts.map +1 -1
- package/dist/components/ui/entity-icon/entity-icon.js +37 -13
- package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
- package/dist/components/ui/field/field.d.ts +36 -13
- package/dist/components/ui/field/field.d.ts.map +1 -1
- package/dist/components/ui/field/field.js +146 -24
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/field/index.d.ts +3 -1
- package/dist/components/ui/field/index.d.ts.map +1 -1
- package/dist/components/ui/field/index.js +3 -2
- package/dist/components/ui/field/number-field.d.ts +19 -0
- package/dist/components/ui/field/number-field.d.ts.map +1 -0
- package/dist/components/ui/field/number-field.js +76 -0
- package/dist/components/ui/field/number-field.js.map +1 -0
- package/dist/components/ui/input/index.d.ts +1 -0
- package/dist/components/ui/input/index.d.ts.map +1 -1
- package/dist/components/ui/input/index.js +2 -1
- package/dist/components/ui/input/input-control.d.ts +11 -0
- package/dist/components/ui/input/input-control.d.ts.map +1 -0
- package/dist/components/ui/input/input-control.js +24 -0
- package/dist/components/ui/input/input-control.js.map +1 -0
- package/dist/components/ui/input/input.d.ts.map +1 -1
- package/dist/components/ui/input/input.js +56 -28
- package/dist/components/ui/input/input.js.map +1 -1
- package/dist/components/ui/input-group/index.d.ts +1 -0
- package/dist/components/ui/input-group/index.d.ts.map +1 -1
- package/dist/components/ui/input-group/index.js +2 -1
- package/dist/components/ui/input-group/input-group.d.ts.map +1 -1
- package/dist/components/ui/input-group/input-group.js +42 -5
- package/dist/components/ui/input-group/input-group.js.map +1 -1
- package/dist/components/ui/input-group/secret-input-group.d.ts +11 -0
- package/dist/components/ui/input-group/secret-input-group.d.ts.map +1 -0
- package/dist/components/ui/input-group/secret-input-group.js +67 -0
- package/dist/components/ui/input-group/secret-input-group.js.map +1 -0
- package/dist/components/ui/native-select/native-select.d.ts.map +1 -1
- package/dist/components/ui/native-select/native-select.js +39 -4
- package/dist/components/ui/native-select/native-select.js.map +1 -1
- package/dist/components/ui/progress/progress.d.ts.map +1 -1
- package/dist/components/ui/progress/progress.js +30 -18
- package/dist/components/ui/progress/progress.js.map +1 -1
- package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group/radio-group.js +41 -4
- package/dist/components/ui/radio-group/radio-group.js.map +1 -1
- package/dist/components/ui/switch/switch.d.ts +2 -0
- package/dist/components/ui/switch/switch.d.ts.map +1 -1
- package/dist/components/ui/switch/switch.js +24 -3
- package/dist/components/ui/switch/switch.js.map +1 -1
- package/dist/components/ui/tabs/tabs.js +1 -1
- package/dist/components/ui/tabs/tabs.js.map +1 -1
- package/dist/components/ui/text-link/index.d.ts +2 -0
- package/dist/components/ui/text-link/index.d.ts.map +1 -0
- package/dist/components/ui/text-link/index.js +2 -0
- package/dist/components/ui/text-link/text-link.d.ts +9 -0
- package/dist/components/ui/text-link/text-link.d.ts.map +1 -0
- package/dist/components/ui/text-link/text-link.js +30 -0
- package/dist/components/ui/text-link/text-link.js.map +1 -0
- package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea/textarea.js +41 -4
- package/dist/components/ui/textarea/textarea.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -8
- package/dist/lib/clipboard.d.ts +3 -0
- package/dist/lib/clipboard.d.ts.map +1 -0
- package/dist/lib/clipboard.js +35 -0
- package/dist/lib/clipboard.js.map +1 -0
- package/dist/lib/download.d.ts +3 -0
- package/dist/lib/download.d.ts.map +1 -0
- package/dist/lib/download.js +31 -0
- package/dist/lib/download.js.map +1 -0
- package/dist/lib/form-field.d.ts +37 -0
- package/dist/lib/form-field.d.ts.map +1 -0
- package/dist/lib/form-field.js +47 -0
- package/dist/lib/form-field.js.map +1 -0
- package/dist/r/app-shell.json +5 -0
- package/dist/r/catalog-browser.json +47 -0
- package/dist/r/combobox.json +5 -0
- package/dist/r/empty.json +10 -1
- package/dist/r/field.json +7 -0
- package/dist/r/floating-preview.json +30 -0
- package/dist/r/input-group.json +6 -0
- package/dist/r/input.json +5 -0
- package/dist/r/lib.json +15 -0
- package/dist/r/list-row.json +1 -0
- package/dist/r/registry.json +159 -1
- package/dist/r/src/components/composites/action-button/action-button.tsx +5 -1
- package/dist/r/src/components/composites/catalog-browser/catalog-browser-group.tsx +148 -0
- package/dist/r/src/components/composites/catalog-browser/catalog-browser.tsx +258 -0
- package/dist/r/src/components/composites/catalog-browser/catalog-detail.tsx +64 -0
- package/dist/r/src/components/composites/catalog-browser/catalog-types.ts +83 -0
- package/dist/r/src/components/composites/catalog-browser/index.ts +10 -0
- package/dist/r/src/components/composites/list-row/list-row.tsx +81 -8
- package/dist/r/src/components/composites/settings/settings.tsx +67 -37
- package/dist/r/src/components/conversation/scroll-follow.ts +109 -15
- package/dist/r/src/components/layout/app-shell/index.ts +1 -0
- package/dist/r/src/components/layout/app-shell/skip-link.tsx +35 -0
- package/dist/r/src/components/layout/floating-preview/floating-preview.tsx +260 -0
- package/dist/r/src/components/layout/floating-preview/index.ts +2 -0
- package/dist/r/src/components/layout/floating-preview/model.ts +285 -0
- package/dist/r/src/components/theme/index.ts +1 -0
- package/dist/r/src/components/theme/theme-mode-toggle.tsx +56 -0
- package/dist/r/src/components/ui/checkbox/checkbox.tsx +20 -3
- package/dist/r/src/components/ui/combobox/combobox.tsx +24 -1
- package/dist/r/src/components/ui/combobox/index.ts +1 -0
- package/dist/r/src/components/ui/combobox/value-combobox.tsx +38 -0
- package/dist/r/src/components/ui/empty/empty-state.tsx +71 -0
- package/dist/r/src/components/ui/empty/index.ts +1 -0
- package/dist/r/src/components/ui/entity-icon/entity-icon.tsx +33 -2
- package/dist/r/src/components/ui/field/field.tsx +102 -5
- package/dist/r/src/components/ui/field/index.ts +5 -0
- package/dist/r/src/components/ui/field/number-field.tsx +71 -0
- package/dist/r/src/components/ui/input/index.ts +1 -0
- package/dist/r/src/components/ui/input/input-control.tsx +38 -0
- package/dist/r/src/components/ui/input/input.tsx +32 -20
- package/dist/r/src/components/ui/input-group/index.ts +1 -0
- package/dist/r/src/components/ui/input-group/input-group.tsx +25 -2
- package/dist/r/src/components/ui/input-group/secret-input-group.tsx +58 -0
- package/dist/r/src/components/ui/native-select/native-select.tsx +27 -1
- package/dist/r/src/components/ui/progress/progress.tsx +12 -8
- package/dist/r/src/components/ui/radio-group/radio-group.tsx +30 -2
- package/dist/r/src/components/ui/switch/switch.tsx +20 -3
- package/dist/r/src/components/ui/tabs/tabs.tsx +1 -1
- package/dist/r/src/components/ui/text-link/index.ts +2 -0
- package/dist/r/src/components/ui/text-link/text-link.tsx +28 -0
- package/dist/r/src/components/ui/textarea/textarea.tsx +24 -1
- package/dist/r/src/lib/clipboard.ts +41 -0
- package/dist/r/src/lib/download.ts +29 -0
- package/dist/r/src/lib/form-field.ts +93 -0
- package/dist/r/text-link.json +22 -0
- package/dist/r/theming.json +6 -0
- package/package.json +1 -1
- package/registry.json +159 -1
- package/src/components/composites/action-button/action-button.tsx +5 -1
- package/src/components/composites/catalog-browser/catalog-browser-group.tsx +148 -0
- package/src/components/composites/catalog-browser/catalog-browser.tsx +258 -0
- package/src/components/composites/catalog-browser/catalog-detail.tsx +64 -0
- package/src/components/composites/catalog-browser/catalog-types.ts +83 -0
- package/src/components/composites/catalog-browser/index.ts +10 -0
- package/src/components/composites/list-row/list-row.tsx +81 -8
- package/src/components/composites/settings/settings.tsx +67 -37
- package/src/components/conversation/scroll-follow.ts +109 -15
- package/src/components/layout/app-shell/index.ts +1 -0
- package/src/components/layout/app-shell/skip-link.tsx +35 -0
- package/src/components/layout/floating-preview/floating-preview.tsx +260 -0
- package/src/components/layout/floating-preview/index.ts +2 -0
- package/src/components/layout/floating-preview/model.ts +285 -0
- package/src/components/theme/index.ts +1 -0
- package/src/components/theme/theme-mode-toggle.tsx +56 -0
- package/src/components/ui/checkbox/checkbox.tsx +20 -3
- package/src/components/ui/combobox/combobox.tsx +24 -1
- package/src/components/ui/combobox/index.ts +1 -0
- package/src/components/ui/combobox/value-combobox.tsx +38 -0
- package/src/components/ui/empty/empty-state.tsx +71 -0
- package/src/components/ui/empty/index.ts +1 -0
- package/src/components/ui/entity-icon/entity-icon.tsx +33 -2
- package/src/components/ui/field/field.tsx +102 -5
- package/src/components/ui/field/index.ts +5 -0
- package/src/components/ui/field/number-field.tsx +71 -0
- package/src/components/ui/input/index.ts +1 -0
- package/src/components/ui/input/input-control.tsx +38 -0
- package/src/components/ui/input/input.tsx +32 -20
- package/src/components/ui/input-group/index.ts +1 -0
- package/src/components/ui/input-group/input-group.tsx +25 -2
- package/src/components/ui/input-group/secret-input-group.tsx +58 -0
- package/src/components/ui/native-select/native-select.tsx +27 -1
- package/src/components/ui/progress/progress.tsx +12 -8
- package/src/components/ui/radio-group/radio-group.tsx +30 -2
- package/src/components/ui/switch/switch.tsx +20 -3
- package/src/components/ui/tabs/tabs.tsx +1 -1
- package/src/components/ui/text-link/index.ts +2 -0
- package/src/components/ui/text-link/text-link.tsx +28 -0
- package/src/components/ui/textarea/textarea.tsx +24 -1
- package/src/index.ts +4 -0
- package/src/lib/clipboard.ts +41 -0
- package/src/lib/download.ts +29 -0
- package/src/lib/form-field.ts +93 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
//#region src/components/layout/floating-preview/model.ts
|
|
2
|
+
var PREVIEW_MINI_PLAYER_EDGE_GAP = 12;
|
|
3
|
+
var PREVIEW_MINI_PLAYER_CORNER_RADIUS = 12;
|
|
4
|
+
var PREVIEW_MINI_PLAYER_DEFAULT_BOX = {
|
|
5
|
+
width: 320,
|
|
6
|
+
height: 320
|
|
7
|
+
};
|
|
8
|
+
var PREVIEW_MINI_PLAYER_MIN_SIZE = {
|
|
9
|
+
width: 240,
|
|
10
|
+
height: 150
|
|
11
|
+
};
|
|
12
|
+
var NO_PREVIEW_MINI_PLAYER_OBSTACLES = { composer: null };
|
|
13
|
+
var spanOf = (x, width) => ({
|
|
14
|
+
left: x,
|
|
15
|
+
right: x + width
|
|
16
|
+
});
|
|
17
|
+
var spansOverlap = (a, b) => a.left < b.right && a.right > b.left;
|
|
18
|
+
/** The lowest row (before the edge gap) open to a player covering these columns. */
|
|
19
|
+
function floorFor(span, container, obstacles) {
|
|
20
|
+
const { composer } = obstacles;
|
|
21
|
+
return composer && spansOverlap(span, composer) ? container.height - Math.max(0, composer.height) : container.height;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The box a stored size is fitted into. A player with a position keeps the
|
|
25
|
+
* rows its own columns have, so a tall frame parked beside the composer
|
|
26
|
+
* survives the next layout pass; without one it takes the rows above the
|
|
27
|
+
* composer, which every column has.
|
|
28
|
+
*/
|
|
29
|
+
var availableArea = (container, obstacles, span) => ({
|
|
30
|
+
width: container.width - 24,
|
|
31
|
+
height: (span ? floorFor(span, container, obstacles) : container.height - Math.max(0, obstacles.composer?.height ?? 0)) - 24
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Width is the player's only free dimension; height always follows the source
|
|
35
|
+
* aspect ratio so the content fills the box without letterboxing. The player
|
|
36
|
+
* never grows past the source's own size, and a tight container wins over the
|
|
37
|
+
* minimum.
|
|
38
|
+
*/
|
|
39
|
+
function fitPreviewMiniPlayerWidth(desiredWidth, source, max) {
|
|
40
|
+
const aspectRatio = source.width / source.height;
|
|
41
|
+
const width = Math.min(Math.max(desiredWidth, PREVIEW_MINI_PLAYER_MIN_SIZE.width, PREVIEW_MINI_PLAYER_MIN_SIZE.height * aspectRatio), source.width, Math.max(1, max.width), Math.max(1, max.height * aspectRatio));
|
|
42
|
+
return {
|
|
43
|
+
width: Math.round(width),
|
|
44
|
+
height: Math.round(width / aspectRatio)
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function defaultPreviewMiniPlayerWidth(source) {
|
|
48
|
+
return Math.min(PREVIEW_MINI_PLAYER_DEFAULT_BOX.width, PREVIEW_MINI_PLAYER_DEFAULT_BOX.height * source.width / source.height);
|
|
49
|
+
}
|
|
50
|
+
var clampToContainer = (position, container, player, bottom = container.height) => ({
|
|
51
|
+
x: Math.min(Math.max(position.x, 12), Math.max(12, container.width - player.width - 12)),
|
|
52
|
+
y: Math.min(Math.max(position.y, 12), Math.max(12, bottom - player.height - 12))
|
|
53
|
+
});
|
|
54
|
+
var overlapsObstacle = (position, player, container, obstacles) => position.y + player.height > floorFor(spanOf(position.x, player.width), container, obstacles);
|
|
55
|
+
/**
|
|
56
|
+
* Keeps the player inside the container and off the composer. An overlapping
|
|
57
|
+
* player is pushed out along whichever side needs the smaller move, so a drag
|
|
58
|
+
* slides along the composer into the margin beside it instead of stopping at
|
|
59
|
+
* its top edge; when no side leaves it fully clear it sits above the composer.
|
|
60
|
+
*/
|
|
61
|
+
function clampPreviewMiniPlayerPosition(position, container, player, obstacles = NO_PREVIEW_MINI_PLAYER_OBSTACLES) {
|
|
62
|
+
const inside = clampToContainer(position, container, player);
|
|
63
|
+
const { composer } = obstacles;
|
|
64
|
+
if (!composer || !overlapsObstacle(inside, player, container, obstacles)) return inside;
|
|
65
|
+
const gap = 12;
|
|
66
|
+
const above = {
|
|
67
|
+
x: inside.x,
|
|
68
|
+
y: container.height - composer.height - gap - player.height
|
|
69
|
+
};
|
|
70
|
+
const beside = [{
|
|
71
|
+
x: composer.left - gap - player.width,
|
|
72
|
+
y: inside.y
|
|
73
|
+
}, {
|
|
74
|
+
x: composer.right + gap,
|
|
75
|
+
y: inside.y
|
|
76
|
+
}];
|
|
77
|
+
let best = clampToContainer(above, container, player);
|
|
78
|
+
let bestDistance = Math.abs(best.y - inside.y);
|
|
79
|
+
for (const candidate of beside) {
|
|
80
|
+
if (clampToContainer(candidate, container, player).x !== candidate.x || overlapsObstacle(candidate, player, container, obstacles)) continue;
|
|
81
|
+
const distance = Math.abs(candidate.x - inside.x);
|
|
82
|
+
if (distance < bestDistance) {
|
|
83
|
+
best = candidate;
|
|
84
|
+
bestDistance = distance;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return best;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Resolves the on-screen frame from the stored width and position. Clamping
|
|
91
|
+
* happens here on every layout pass instead of being written back to the
|
|
92
|
+
* store, so a temporarily narrow container never destroys the user's chosen
|
|
93
|
+
* width. A player without a position sits in the top-right corner.
|
|
94
|
+
*/
|
|
95
|
+
function resolvePreviewMiniPlayerFrame(input) {
|
|
96
|
+
const { width, position, source, container, obstacles = NO_PREVIEW_MINI_PLAYER_OBSTACLES } = input;
|
|
97
|
+
const size = fitPreviewMiniPlayerWidth(width ?? defaultPreviewMiniPlayerWidth(source), source, availableArea(container, obstacles, position && width ? spanOf(position.x, width) : null));
|
|
98
|
+
return {
|
|
99
|
+
...clampPreviewMiniPlayerPosition(position ?? {
|
|
100
|
+
x: container.width - 12 - size.width,
|
|
101
|
+
y: 12
|
|
102
|
+
}, container, size, obstacles),
|
|
103
|
+
...size
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Resizes from any edge or corner while holding the aspect ratio. The edge
|
|
108
|
+
* opposite the dragged one stays anchored, so growth stops at the container
|
|
109
|
+
* on that axis and the pointer keeps tracking the grabbed edge.
|
|
110
|
+
*/
|
|
111
|
+
function resizePreviewMiniPlayer(input) {
|
|
112
|
+
const { start, direction, delta, source, container, obstacles = NO_PREVIEW_MINI_PLAYER_OBSTACLES } = input;
|
|
113
|
+
const east = direction.includes("east");
|
|
114
|
+
const west = direction.includes("west");
|
|
115
|
+
const north = direction.includes("north");
|
|
116
|
+
const south = direction.includes("south");
|
|
117
|
+
const right = start.x + start.width;
|
|
118
|
+
const bottom = start.y + start.height;
|
|
119
|
+
const floor = floorFor(spanOf(start.x, start.width), container, obstacles);
|
|
120
|
+
const max = {
|
|
121
|
+
width: west ? right - 12 : east ? container.width - 12 - start.x : container.width - 24,
|
|
122
|
+
height: north ? bottom - 12 : south ? floor - 12 - start.y : floor - 24
|
|
123
|
+
};
|
|
124
|
+
const desiredWidth = start.width + (east ? delta.x : west ? -delta.x : 0);
|
|
125
|
+
const desiredHeight = start.height + (south ? delta.y : north ? -delta.y : 0);
|
|
126
|
+
const horizontal = east || west;
|
|
127
|
+
const vertical = north || south;
|
|
128
|
+
const size = fitPreviewMiniPlayerWidth((horizontal && !vertical ? true : vertical && !horizontal ? false : Math.abs(desiredWidth - start.width) / start.width >= Math.abs(desiredHeight - start.height) / start.height) ? desiredWidth : desiredHeight * source.width / source.height, source, max);
|
|
129
|
+
return {
|
|
130
|
+
...clampPreviewMiniPlayerPosition({
|
|
131
|
+
x: west ? right - size.width : start.x,
|
|
132
|
+
y: north ? bottom - size.height : start.y
|
|
133
|
+
}, container, size, obstacles),
|
|
134
|
+
...size
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
var FLOATING_PREVIEW_EDGE_GAP = 12;
|
|
138
|
+
var FLOATING_PREVIEW_CORNER_RADIUS = 12;
|
|
139
|
+
var NO_FLOATING_PREVIEW_OBSTACLES = NO_PREVIEW_MINI_PLAYER_OBSTACLES;
|
|
140
|
+
var resolveFloatingPreviewFrame = resolvePreviewMiniPlayerFrame;
|
|
141
|
+
var resizeFloatingPreview = resizePreviewMiniPlayer;
|
|
142
|
+
var clampFloatingPreviewPosition = clampPreviewMiniPlayerPosition;
|
|
143
|
+
//#endregion
|
|
144
|
+
export { FLOATING_PREVIEW_CORNER_RADIUS, FLOATING_PREVIEW_EDGE_GAP, NO_FLOATING_PREVIEW_OBSTACLES, NO_PREVIEW_MINI_PLAYER_OBSTACLES, PREVIEW_MINI_PLAYER_CORNER_RADIUS, PREVIEW_MINI_PLAYER_EDGE_GAP, clampFloatingPreviewPosition, clampPreviewMiniPlayerPosition, resizeFloatingPreview, resizePreviewMiniPlayer, resolveFloatingPreviewFrame, resolvePreviewMiniPlayerFrame };
|
|
145
|
+
|
|
146
|
+
//# sourceMappingURL=model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","names":[],"sources":["../../../../src/components/layout/floating-preview/model.ts"],"sourcesContent":["/*\n * Copyright (c) 2026 Adea contributors\n * SPDX-License-Identifier: MIT\n * Geometry translated from t3code apps/web/src/components/preview/\n * previewMiniPlayerLayout.ts, issue #422, revision\n * 77bca8b2d76a1f42552e5eee7d277fcb1160347a (MIT). Runtime and device\n * behavior are excluded. See NOTICE.\n */\n\nexport const PREVIEW_MINI_PLAYER_EDGE_GAP = 12\nexport const PREVIEW_MINI_PLAYER_CORNER_RADIUS = 12\nexport interface PreviewMiniPlayerSize {\n readonly width: number\n readonly height: number\n}\nexport interface PreviewMiniPlayerPosition {\n readonly x: number\n readonly y: number\n}\nexport interface PreviewMiniPlayerFrame extends PreviewMiniPlayerPosition, PreviewMiniPlayerSize {}\n\nexport type BrowserViewportResizeDirection =\n | 'north'\n | 'south'\n | 'east'\n | 'west'\n | 'northwest'\n | 'northeast'\n | 'southwest'\n | 'southeast'\n\nconst PREVIEW_MINI_PLAYER_DEFAULT_BOX = { width: 320, height: 320 } as const\nconst PREVIEW_MINI_PLAYER_MIN_SIZE = { width: 240, height: 150 } as const\n\ninterface HorizontalSpan {\n readonly left: number\n readonly right: number\n}\n\n/**\n * The composer stack docked to the bottom edge, in container coordinates. It\n * only reserves the columns it covers, so the margins beside it stay open all\n * the way down.\n */\nexport interface PreviewMiniPlayerObstacles {\n readonly composer: (HorizontalSpan & { readonly height: number }) | null\n}\n\nexport const NO_PREVIEW_MINI_PLAYER_OBSTACLES: PreviewMiniPlayerObstacles = { composer: null }\n\nconst spanOf = (x: number, width: number): HorizontalSpan => ({ left: x, right: x + width })\n\nconst spansOverlap = (a: HorizontalSpan, b: HorizontalSpan) => a.left < b.right && a.right > b.left\n\n/** The lowest row (before the edge gap) open to a player covering these columns. */\nfunction floorFor(\n span: HorizontalSpan,\n container: PreviewMiniPlayerSize,\n obstacles: PreviewMiniPlayerObstacles\n): number {\n const { composer } = obstacles\n return composer && spansOverlap(span, composer)\n ? container.height - Math.max(0, composer.height)\n : container.height\n}\n\n/**\n * The box a stored size is fitted into. A player with a position keeps the\n * rows its own columns have, so a tall frame parked beside the composer\n * survives the next layout pass; without one it takes the rows above the\n * composer, which every column has.\n */\nconst availableArea = (\n container: PreviewMiniPlayerSize,\n obstacles: PreviewMiniPlayerObstacles,\n span: HorizontalSpan | null\n): PreviewMiniPlayerSize => ({\n width: container.width - PREVIEW_MINI_PLAYER_EDGE_GAP * 2,\n height:\n (span\n ? floorFor(span, container, obstacles)\n : container.height - Math.max(0, obstacles.composer?.height ?? 0)) -\n PREVIEW_MINI_PLAYER_EDGE_GAP * 2,\n})\n\n/**\n * Width is the player's only free dimension; height always follows the source\n * aspect ratio so the content fills the box without letterboxing. The player\n * never grows past the source's own size, and a tight container wins over the\n * minimum.\n */\nfunction fitPreviewMiniPlayerWidth(\n desiredWidth: number,\n source: PreviewMiniPlayerSize,\n max: PreviewMiniPlayerSize\n): PreviewMiniPlayerSize {\n const aspectRatio = source.width / source.height\n const width = Math.min(\n Math.max(\n desiredWidth,\n PREVIEW_MINI_PLAYER_MIN_SIZE.width,\n PREVIEW_MINI_PLAYER_MIN_SIZE.height * aspectRatio\n ),\n source.width,\n Math.max(1, max.width),\n Math.max(1, max.height * aspectRatio)\n )\n return { width: Math.round(width), height: Math.round(width / aspectRatio) }\n}\n\nfunction defaultPreviewMiniPlayerWidth(source: PreviewMiniPlayerSize): number {\n return Math.min(\n PREVIEW_MINI_PLAYER_DEFAULT_BOX.width,\n (PREVIEW_MINI_PLAYER_DEFAULT_BOX.height * source.width) / source.height\n )\n}\n\nconst clampToContainer = (\n position: PreviewMiniPlayerPosition,\n container: PreviewMiniPlayerSize,\n player: PreviewMiniPlayerSize,\n bottom = container.height\n): PreviewMiniPlayerPosition => ({\n x: Math.min(\n Math.max(position.x, PREVIEW_MINI_PLAYER_EDGE_GAP),\n Math.max(\n PREVIEW_MINI_PLAYER_EDGE_GAP,\n container.width - player.width - PREVIEW_MINI_PLAYER_EDGE_GAP\n )\n ),\n y: Math.min(\n Math.max(position.y, PREVIEW_MINI_PLAYER_EDGE_GAP),\n Math.max(PREVIEW_MINI_PLAYER_EDGE_GAP, bottom - player.height - PREVIEW_MINI_PLAYER_EDGE_GAP)\n ),\n})\n\nconst overlapsObstacle = (\n position: PreviewMiniPlayerPosition,\n player: PreviewMiniPlayerSize,\n container: PreviewMiniPlayerSize,\n obstacles: PreviewMiniPlayerObstacles\n): boolean =>\n position.y + player.height > floorFor(spanOf(position.x, player.width), container, obstacles)\n\n/**\n * Keeps the player inside the container and off the composer. An overlapping\n * player is pushed out along whichever side needs the smaller move, so a drag\n * slides along the composer into the margin beside it instead of stopping at\n * its top edge; when no side leaves it fully clear it sits above the composer.\n */\nexport function clampPreviewMiniPlayerPosition(\n position: PreviewMiniPlayerPosition,\n container: PreviewMiniPlayerSize,\n player: PreviewMiniPlayerSize,\n obstacles: PreviewMiniPlayerObstacles = NO_PREVIEW_MINI_PLAYER_OBSTACLES\n): PreviewMiniPlayerPosition {\n const inside = clampToContainer(position, container, player)\n const { composer } = obstacles\n if (!composer || !overlapsObstacle(inside, player, container, obstacles)) return inside\n const gap = PREVIEW_MINI_PLAYER_EDGE_GAP\n const above = { x: inside.x, y: container.height - composer.height - gap - player.height }\n const beside = [\n { x: composer.left - gap - player.width, y: inside.y },\n { x: composer.right + gap, y: inside.y },\n ]\n let best = clampToContainer(above, container, player)\n let bestDistance = Math.abs(best.y - inside.y)\n for (const candidate of beside) {\n const clamped = clampToContainer(candidate, container, player)\n if (clamped.x !== candidate.x || overlapsObstacle(candidate, player, container, obstacles)) {\n continue\n }\n const distance = Math.abs(candidate.x - inside.x)\n if (distance < bestDistance) {\n best = candidate\n bestDistance = distance\n }\n }\n return best\n}\n\n/**\n * Resolves the on-screen frame from the stored width and position. Clamping\n * happens here on every layout pass instead of being written back to the\n * store, so a temporarily narrow container never destroys the user's chosen\n * width. A player without a position sits in the top-right corner.\n */\nexport function resolvePreviewMiniPlayerFrame(input: {\n readonly width: number | null\n readonly position: PreviewMiniPlayerPosition | null\n readonly source: PreviewMiniPlayerSize\n readonly container: PreviewMiniPlayerSize\n readonly obstacles?: PreviewMiniPlayerObstacles\n}): PreviewMiniPlayerFrame {\n const { width, position, source, container, obstacles = NO_PREVIEW_MINI_PLAYER_OBSTACLES } = input\n const size = fitPreviewMiniPlayerWidth(\n width ?? defaultPreviewMiniPlayerWidth(source),\n source,\n availableArea(container, obstacles, position && width ? spanOf(position.x, width) : null)\n )\n const anchored = position ?? {\n x: container.width - PREVIEW_MINI_PLAYER_EDGE_GAP - size.width,\n y: PREVIEW_MINI_PLAYER_EDGE_GAP,\n }\n return { ...clampPreviewMiniPlayerPosition(anchored, container, size, obstacles), ...size }\n}\n\n/**\n * Resizes from any edge or corner while holding the aspect ratio. The edge\n * opposite the dragged one stays anchored, so growth stops at the container\n * on that axis and the pointer keeps tracking the grabbed edge.\n */\nexport function resizePreviewMiniPlayer(input: {\n readonly start: PreviewMiniPlayerFrame\n readonly direction: BrowserViewportResizeDirection\n readonly delta: PreviewMiniPlayerPosition\n readonly source: PreviewMiniPlayerSize\n readonly container: PreviewMiniPlayerSize\n readonly obstacles?: PreviewMiniPlayerObstacles\n}): PreviewMiniPlayerFrame {\n const {\n start,\n direction,\n delta,\n source,\n container,\n obstacles = NO_PREVIEW_MINI_PLAYER_OBSTACLES,\n } = input\n const east = direction.includes('east')\n const west = direction.includes('west')\n const north = direction.includes('north')\n const south = direction.includes('south')\n const right = start.x + start.width\n const bottom = start.y + start.height\n const floor = floorFor(spanOf(start.x, start.width), container, obstacles)\n const max = {\n width: west\n ? right - PREVIEW_MINI_PLAYER_EDGE_GAP\n : east\n ? container.width - PREVIEW_MINI_PLAYER_EDGE_GAP - start.x\n : container.width - PREVIEW_MINI_PLAYER_EDGE_GAP * 2,\n height: north\n ? bottom - PREVIEW_MINI_PLAYER_EDGE_GAP\n : south\n ? floor - PREVIEW_MINI_PLAYER_EDGE_GAP - start.y\n : floor - PREVIEW_MINI_PLAYER_EDGE_GAP * 2,\n }\n const desiredWidth = start.width + (east ? delta.x : west ? -delta.x : 0)\n const desiredHeight = start.height + (south ? delta.y : north ? -delta.y : 0)\n const horizontal = east || west\n const vertical = north || south\n const widthLeads =\n horizontal && !vertical\n ? true\n : vertical && !horizontal\n ? false\n : Math.abs(desiredWidth - start.width) / start.width >=\n Math.abs(desiredHeight - start.height) / start.height\n const size = fitPreviewMiniPlayerWidth(\n widthLeads ? desiredWidth : (desiredHeight * source.width) / source.height,\n source,\n max\n )\n const position = clampPreviewMiniPlayerPosition(\n { x: west ? right - size.width : start.x, y: north ? bottom - size.height : start.y },\n container,\n size,\n obstacles\n )\n return { ...position, ...size }\n}\n\n// Product-neutral names for new consumers. The PreviewMiniPlayer names stay\n// exported for Adea Dev Runtime's existing browser model API.\nexport type FloatingPreviewSize = PreviewMiniPlayerSize\nexport type FloatingPreviewPosition = PreviewMiniPlayerPosition\nexport type FloatingPreviewFrame = PreviewMiniPlayerFrame\nexport type FloatingPreviewResizeDirection = BrowserViewportResizeDirection\nexport type FloatingPreviewObstacles = PreviewMiniPlayerObstacles\nexport const FLOATING_PREVIEW_EDGE_GAP = PREVIEW_MINI_PLAYER_EDGE_GAP\nexport const FLOATING_PREVIEW_CORNER_RADIUS = PREVIEW_MINI_PLAYER_CORNER_RADIUS\nexport const NO_FLOATING_PREVIEW_OBSTACLES = NO_PREVIEW_MINI_PLAYER_OBSTACLES\nexport const resolveFloatingPreviewFrame = resolvePreviewMiniPlayerFrame\nexport const resizeFloatingPreview = resizePreviewMiniPlayer\nexport const clampFloatingPreviewPosition = clampPreviewMiniPlayerPosition\n"],"mappings":";AASA,IAAa,+BAA+B;AAC5C,IAAa,oCAAoC;AAqBjD,IAAM,kCAAkC;CAAE,OAAO;CAAK,QAAQ;AAAI;AAClE,IAAM,+BAA+B;CAAE,OAAO;CAAK,QAAQ;AAAI;AAgB/D,IAAa,mCAA+D,EAAE,UAAU,KAAK;AAE7F,IAAM,UAAU,GAAW,WAAmC;CAAE,MAAM;CAAG,OAAO,IAAI;AAAM;AAE1F,IAAM,gBAAgB,GAAmB,MAAsB,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE;;AAG/F,SAAS,SACP,MACA,WACA,WACQ;CACR,MAAM,EAAE,aAAa;CACrB,OAAO,YAAY,aAAa,MAAM,QAAQ,IAC1C,UAAU,SAAS,KAAK,IAAI,GAAG,SAAS,MAAM,IAC9C,UAAU;AAChB;;;;;;;AAQA,IAAM,iBACJ,WACA,WACA,UAC2B;CAC3B,OAAO,UAAU,QAAQ;CACzB,SACG,OACG,SAAS,MAAM,WAAW,SAAS,IACnC,UAAU,SAAS,KAAK,IAAI,GAAG,UAAU,UAAU,UAAU,CAAC,KAClE;AACJ;;;;;;;AAQA,SAAS,0BACP,cACA,QACA,KACuB;CACvB,MAAM,cAAc,OAAO,QAAQ,OAAO;CAC1C,MAAM,QAAQ,KAAK,IACjB,KAAK,IACH,cACA,6BAA6B,OAC7B,6BAA6B,SAAS,WACxC,GACA,OAAO,OACP,KAAK,IAAI,GAAG,IAAI,KAAK,GACrB,KAAK,IAAI,GAAG,IAAI,SAAS,WAAW,CACtC;CACA,OAAO;EAAE,OAAO,KAAK,MAAM,KAAK;EAAG,QAAQ,KAAK,MAAM,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B,MAAM,WAAW,SAAS;CAQ1B,MAAM,OAAO,2BANX,cAAc,CAAC,WACX,OACA,YAAY,CAAC,aACX,QACA,KAAK,IAAI,eAAe,MAAM,KAAK,IAAI,MAAM,SAC7C,KAAK,IAAI,gBAAgB,MAAM,MAAM,IAAI,MAAM,UAExC,eAAgB,gBAAgB,OAAO,QAAS,OAAO,QACpE,QACA,GACF;CAOA,OAAO;EAAE,GANQ,+BACf;GAAE,GAAG,OAAO,QAAQ,KAAK,QAAQ,MAAM;GAAG,GAAG,QAAQ,SAAS,KAAK,SAAS,MAAM;EAAE,GACpF,WACA,MACA,SAEU;EAAU,GAAG;CAAK;AAChC;AASA,IAAa,4BAAA;AACb,IAAa,iCAAA;AACb,IAAa,gCAAgC;AAC7C,IAAa,8BAA8B;AAC3C,IAAa,wBAAwB;AACrC,IAAa,+BAA+B"}
|
|
@@ -2,4 +2,5 @@ export { AppearancePanel, type AppearancePanelProps } from './appearance-panel';
|
|
|
2
2
|
export { ThemePicker, ThemePreview, ThemeSwatch, type ThemePickerProps, type ThemePreviewProps, type ThemeSwatchProps, } from './theme-picker';
|
|
3
3
|
export { ThemeProvider, defaultThemeSelection, inlineScriptLiteral, resolvedDensity, themeScript, useTheme, type ThemeContextValue, type ThemeDensity, type ThemeProviderProps, type ThemeSelection, } from './theme-provider';
|
|
4
4
|
export { ThemeToggle, type ThemeToggleProps } from './theme-toggle';
|
|
5
|
+
export { ThemeModeToggle, type ThemeModeToggleProps } from './theme-mode-toggle';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAC/E,OAAO,EACL,WAAW,EACX,YAAY,EACZ,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,QAAQ,EACR,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,cAAc,GACpB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAC/E,OAAO,EACL,WAAW,EACX,YAAY,EACZ,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,QAAQ,EACR,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,cAAc,GACpB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -2,4 +2,5 @@ import { ThemePicker, ThemePreview, ThemeSwatch } from "./theme-picker.js";
|
|
|
2
2
|
import { ThemeProvider, defaultThemeSelection, inlineScriptLiteral, resolvedDensity, themeScript, useTheme } from "./theme-provider.js";
|
|
3
3
|
import { AppearancePanel } from "./appearance-panel.js";
|
|
4
4
|
import { ThemeToggle } from "./theme-toggle.js";
|
|
5
|
-
|
|
5
|
+
import { ThemeModeToggle } from "./theme-mode-toggle.js";
|
|
6
|
+
export { AppearancePanel, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, defaultThemeSelection, inlineScriptLiteral, resolvedDensity, themeScript, useTheme };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComponentProps } from 'solid-js';
|
|
2
|
+
import { ToggleGroup } from '../ui/toggle-group/toggle-group';
|
|
3
|
+
/** Controlled appearance selection for hosts that own their preference storage. */
|
|
4
|
+
export type ThemeModeToggleProps = Omit<ComponentProps<typeof ToggleGroup>, 'children' | 'value' | 'onChange' | 'multiple'> & {
|
|
5
|
+
mode: 'light' | 'dark' | 'system';
|
|
6
|
+
onModeChange: (mode: 'light' | 'dark' | 'system') => void;
|
|
7
|
+
withLabels?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare function ThemeModeToggle(props: ThemeModeToggleProps): import("solid-js").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=theme-mode-toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-mode-toggle.d.ts","sourceRoot":"","sources":["../../../src/components/theme/theme-mode-toggle.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,EAAE,WAAW,EAAmB,MAAM,iCAAiC,CAAA;AAS9E,mFAAmF;AACnF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,cAAc,CAAC,OAAO,WAAW,CAAC,EAClC,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAC/C,GAAG;IACF,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAA;IACjC,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,KAAK,IAAI,CAAA;IACzD,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,kCAiC1D"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip/tooltip.js";
|
|
2
|
+
import { ToggleGroup, ToggleGroupItem } from "../ui/toggle-group/toggle-group.js";
|
|
3
|
+
import { createComponent, insert, memo, mergeProps, template } from "solid-js/web";
|
|
4
|
+
import { Monitor, Moon, Sun } from "lucide-solid";
|
|
5
|
+
import { For, splitProps } from "solid-js";
|
|
6
|
+
//#region src/components/theme/theme-mode-toggle.tsx
|
|
7
|
+
var _tmpl$ = /*#__PURE__*/ template(`<span>`);
|
|
8
|
+
var APPEARANCES = [
|
|
9
|
+
{
|
|
10
|
+
value: "light",
|
|
11
|
+
label: "Light",
|
|
12
|
+
icon: Sun
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
value: "dark",
|
|
16
|
+
label: "Dark",
|
|
17
|
+
icon: Moon
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
value: "system",
|
|
21
|
+
label: "System",
|
|
22
|
+
icon: Monitor
|
|
23
|
+
}
|
|
24
|
+
];
|
|
25
|
+
function ThemeModeToggle(props) {
|
|
26
|
+
const [local, rest] = splitProps(props, [
|
|
27
|
+
"mode",
|
|
28
|
+
"onModeChange",
|
|
29
|
+
"withLabels"
|
|
30
|
+
]);
|
|
31
|
+
return createComponent(ToggleGroup, mergeProps(rest, {
|
|
32
|
+
attached: true,
|
|
33
|
+
multiple: false,
|
|
34
|
+
get value() {
|
|
35
|
+
return local.mode;
|
|
36
|
+
},
|
|
37
|
+
onChange: (value) => {
|
|
38
|
+
const option = APPEARANCES.find((candidate) => candidate.value === value);
|
|
39
|
+
if (option) local.onModeChange(option.value);
|
|
40
|
+
},
|
|
41
|
+
get ["aria-label"]() {
|
|
42
|
+
return rest["aria-label"] ?? "Appearance";
|
|
43
|
+
},
|
|
44
|
+
get children() {
|
|
45
|
+
return createComponent(For, {
|
|
46
|
+
each: APPEARANCES,
|
|
47
|
+
children: (appearance) => createComponent(Tooltip, { get children() {
|
|
48
|
+
return [createComponent(TooltipTrigger, {
|
|
49
|
+
as: ToggleGroupItem,
|
|
50
|
+
get value() {
|
|
51
|
+
return appearance.value;
|
|
52
|
+
},
|
|
53
|
+
variant: "outline",
|
|
54
|
+
get size() {
|
|
55
|
+
return local.withLabels ? "sm" : "icon-sm";
|
|
56
|
+
},
|
|
57
|
+
get ["aria-label"]() {
|
|
58
|
+
return appearance.label;
|
|
59
|
+
},
|
|
60
|
+
get children() {
|
|
61
|
+
return [createComponent(appearance.icon, { "aria-hidden": "true" }), memo(() => memo(() => !!local.withLabels)() ? (() => {
|
|
62
|
+
var _el$ = _tmpl$();
|
|
63
|
+
insert(_el$, () => appearance.label);
|
|
64
|
+
return _el$;
|
|
65
|
+
})() : null)];
|
|
66
|
+
}
|
|
67
|
+
}), createComponent(TooltipContent, { get children() {
|
|
68
|
+
return [
|
|
69
|
+
"Use ",
|
|
70
|
+
memo(() => appearance.label.toLowerCase()),
|
|
71
|
+
" appearance"
|
|
72
|
+
];
|
|
73
|
+
} })];
|
|
74
|
+
} })
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { ThemeModeToggle };
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=theme-mode-toggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-mode-toggle.js","names":["Monitor","Moon","Sun","ComponentProps","For","splitProps","ToggleGroup","ToggleGroupItem","Tooltip","TooltipContent","TooltipTrigger","APPEARANCES","value","label","icon","const","ThemeModeToggleProps","Omit","mode","onModeChange","withLabels","ThemeModeToggle","props","local","rest","_$createComponent","_$mergeProps","attached","multiple","onChange","option","find","candidate","aria-label","children","each","appearance","as","variant","size","_$memo","_el$","_tmpl$","_$insert","toLowerCase","_$createComponent","_$mergeProps","_$memo"],"sources":["../../../src/components/theme/theme-mode-toggle.tsx"],"sourcesContent":["import { Monitor, Moon, Sun } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { For, splitProps } from 'solid-js'\nimport { ToggleGroup, ToggleGroupItem } from '../ui/toggle-group/toggle-group'\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip'\n\nconst APPEARANCES = [\n { value: 'light', label: 'Light', icon: Sun },\n { value: 'dark', label: 'Dark', icon: Moon },\n { value: 'system', label: 'System', icon: Monitor },\n] as const\n\n/** Controlled appearance selection for hosts that own their preference storage. */\nexport type ThemeModeToggleProps = Omit<\n ComponentProps<typeof ToggleGroup>,\n 'children' | 'value' | 'onChange' | 'multiple'\n> & {\n mode: 'light' | 'dark' | 'system'\n onModeChange: (mode: 'light' | 'dark' | 'system') => void\n withLabels?: boolean\n}\n\nexport function ThemeModeToggle(props: ThemeModeToggleProps) {\n const [local, rest] = splitProps(props, ['mode', 'onModeChange', 'withLabels'])\n return (\n <ToggleGroup\n {...rest}\n attached\n multiple={false}\n value={local.mode}\n onChange={(value: string | null) => {\n const option = APPEARANCES.find((candidate) => candidate.value === value)\n if (option) local.onModeChange(option.value)\n }}\n aria-label={rest['aria-label'] ?? 'Appearance'}\n >\n <For each={APPEARANCES}>\n {(appearance) => (\n <Tooltip>\n <TooltipTrigger\n as={ToggleGroupItem}\n value={appearance.value}\n variant=\"outline\"\n size={local.withLabels ? 'sm' : 'icon-sm'}\n aria-label={appearance.label}\n >\n <appearance.icon aria-hidden=\"true\" />\n {local.withLabels ? <span>{appearance.label}</span> : null}\n </TooltipTrigger>\n <TooltipContent>Use {appearance.label.toLowerCase()} appearance</TooltipContent>\n </Tooltip>\n )}\n </For>\n </ToggleGroup>\n )\n}\n"],"mappings":";;;;;;;AAMA,IAAMW,cAAc;CAClB;EAAEC,OAAO;EAASC,OAAO;EAASC,MAAMZ;CAAI;CAC5C;EAAEU,OAAO;EAAQC,OAAO;EAAQC,MAAMb;CAAK;CAC3C;EAAEW,OAAO;EAAUC,OAAO;EAAUC,MAAMd;CAAQ;AAAC;AAarD,SAAgBqB,gBAAg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AA;AAIT"}
|
|
@@ -14,6 +14,8 @@ import type { ComponentProps, JSX } from 'solid-js';
|
|
|
14
14
|
* the ring lives on the control and reads the input's focus state.
|
|
15
15
|
*/
|
|
16
16
|
export type CheckboxProps = Omit<ComponentProps<typeof KobalteCheckbox>, 'children'> & {
|
|
17
|
+
/** ID for the hidden native checkbox input; useful with an external label. */
|
|
18
|
+
inputId?: string;
|
|
17
19
|
controlClass?: string;
|
|
18
20
|
labelClass?: string;
|
|
19
21
|
descriptionClass?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/checkbox/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/checkbox/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAKnD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,EAAE,UAAU,CAAC,GAAG;IACrF,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,KAAK,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACnB,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACvB,CAAA;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,eAsF5C;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,eAGhF;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,eAQ5F"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { useFormFieldControl } from "../../../lib/form-field.js";
|
|
2
3
|
import { createComponent, insert, memo, mergeProps, template } from "solid-js/web";
|
|
3
4
|
import { Check, Minus } from "lucide-solid";
|
|
4
5
|
import { splitProps } from "solid-js";
|
|
@@ -19,10 +20,24 @@ function Checkbox$1(props) {
|
|
|
19
20
|
"aria-labelledby",
|
|
20
21
|
"aria-describedby",
|
|
21
22
|
"aria-invalid",
|
|
23
|
+
"aria-errormessage",
|
|
22
24
|
"aria-busy",
|
|
25
|
+
"id",
|
|
26
|
+
"inputId",
|
|
23
27
|
"title"
|
|
24
28
|
]);
|
|
29
|
+
const field = useFormFieldControl("control", {
|
|
30
|
+
id: local.inputId ?? local.id,
|
|
31
|
+
"aria-label": local["aria-label"],
|
|
32
|
+
"aria-labelledby": local["aria-labelledby"],
|
|
33
|
+
"aria-describedby": local["aria-describedby"],
|
|
34
|
+
"aria-invalid": local["aria-invalid"],
|
|
35
|
+
"aria-errormessage": local["aria-errormessage"]
|
|
36
|
+
});
|
|
25
37
|
return createComponent(Checkbox, mergeProps({
|
|
38
|
+
get id() {
|
|
39
|
+
return field ? void 0 : local.id;
|
|
40
|
+
},
|
|
26
41
|
get title() {
|
|
27
42
|
return local.title;
|
|
28
43
|
},
|
|
@@ -32,17 +47,23 @@ function Checkbox$1(props) {
|
|
|
32
47
|
}, rest, { get children() {
|
|
33
48
|
return [
|
|
34
49
|
createComponent(Checkbox.Input, {
|
|
50
|
+
get id() {
|
|
51
|
+
return field?.id ?? local.inputId;
|
|
52
|
+
},
|
|
35
53
|
get ["aria-label"]() {
|
|
36
54
|
return local["aria-label"];
|
|
37
55
|
},
|
|
38
56
|
get ["aria-labelledby"]() {
|
|
39
|
-
return local["aria-labelledby"];
|
|
57
|
+
return field?.["aria-labelledby"] ?? local["aria-labelledby"];
|
|
40
58
|
},
|
|
41
59
|
get ["aria-describedby"]() {
|
|
42
|
-
return local["aria-describedby"];
|
|
60
|
+
return field?.["aria-describedby"] ?? local["aria-describedby"];
|
|
43
61
|
},
|
|
44
62
|
get ["aria-invalid"]() {
|
|
45
|
-
return local["aria-invalid"];
|
|
63
|
+
return field?.["aria-invalid"] ?? local["aria-invalid"];
|
|
64
|
+
},
|
|
65
|
+
get ["aria-errormessage"]() {
|
|
66
|
+
return field?.["aria-errormessage"] ?? local["aria-errormessage"];
|
|
46
67
|
},
|
|
47
68
|
get ["aria-busy"]() {
|
|
48
69
|
return local["aria-busy"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","names":["Checkbox","KobalteCheckbox","Check","Minus","ComponentProps","JSX","splitProps","cn","CheckboxProps","Omit","controlClass","labelClass","descriptionClass","label","Element","description","children","props","local","rest","_$createComponent","_$mergeProps","title","class","Input","aria-label","aria-labelledby","aria-describedby","aria-invalid","aria-busy","Control","Indicator","_$memo","indeterminate","_el$","_tmpl$","_$insert","_c$","Label","_c$2","Description","CheckboxLabel","CheckboxDescription","Checkbox","_$createComponent","KobalteCheckbox","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/checkbox/checkbox.tsx"],"sourcesContent":["import { Checkbox as KobalteCheckbox } from '@kobalte/core/checkbox'\nimport { Check, Minus } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Checkbox.\n *\n * Three states: unchecked, checked, and indeterminate. Indeterminate is what a\n * \"select all\" box shows when only some rows are selected; Kobalte expresses\n * it through `checked=\"indeterminate\"` rather than a second boolean, so there\n * is no way to render a box that is both.\n *\n * The paint is `Control` and the value is a real hidden `Input`, so the control\n * participates in a form submission and in native validation while looking\n * nothing like a browser checkbox. Focus is tracked by the input, which is why\n * the ring lives on the control and reads the input's focus state.\n */\nexport type CheckboxProps = Omit<ComponentProps<typeof KobalteCheckbox>, 'children'> & {\n controlClass?: string\n labelClass?: string\n descriptionClass?: string\n label?: JSX.Element\n description?: JSX.Element\n /**\n * Replaces the control and label. Omit it to get the default control beside\n * `label` and `description`; supply it to compose the parts yourself.\n */\n children?: JSX.Element\n}\n\nexport function Checkbox(props: CheckboxProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'controlClass',\n 'labelClass',\n 'descriptionClass',\n 'children',\n 'label',\n 'description',\n 'indeterminate',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-busy',\n 'title',\n ])\n\n return (\n <KobalteCheckbox\n title={local.title}\n class={cn('group/checkbox flex items-start gap-2.5', local.class)}\n {...rest}\n >\n {/*\n * The name goes on the input, which is what carries the value and takes\n * focus. On the Root it would land on a plain div and name nothing — the\n * box would announce its state with no subject.\n */}\n <KobalteCheckbox.Input\n aria-label={local['aria-label']}\n aria-labelledby={local['aria-labelledby']}\n aria-describedby={local['aria-describedby']}\n aria-invalid={local['aria-invalid']}\n aria-busy={local['aria-busy']}\n title={local.title}\n />\n <KobalteCheckbox.Control\n class={cn(\n 'border-input bg-transparent flex size-4 shrink-0 items-center justify-center rounded-sm border',\n 'transition-[color,box-shadow,border-color,background-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'data-[checked]:bg-primary data-[checked]:border-primary data-[checked]:text-primary-foreground',\n 'data-[indeterminate]:bg-primary data-[indeterminate]:border-primary data-[indeterminate]:text-primary-foreground',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n local.controlClass\n )}\n >\n <KobalteCheckbox.Indicator class=\"flex items-center justify-center\">\n {local.indeterminate ? <Minus class=\"size-3\" /> : <Check class=\"size-3\" />}\n </KobalteCheckbox.Indicator>\n </KobalteCheckbox.Control>\n {local.children ??\n (local.label || local.description ? (\n <div class=\"grid gap-0.5\">\n {local.label ? (\n <KobalteCheckbox.Label class={cn('text-sm font-medium', local.labelClass)}>\n {local.label}\n </KobalteCheckbox.Label>\n ) : null}\n {local.description ? (\n <KobalteCheckbox.Description\n class={cn('text-muted-foreground text-sm', local.descriptionClass)}\n >\n {local.description}\n </KobalteCheckbox.Description>\n ) : null}\n </div>\n ) : null)}\n </KobalteCheckbox>\n )\n}\n\n/**\n * The box's own label. Valid only inside a `<Checkbox>`, for the same reason as\n * `SwitchLabel`: outside its root there is no control to associate with.\n */\nexport function CheckboxLabel(props: ComponentProps<typeof KobalteCheckbox.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteCheckbox.Label class={cn('text-sm font-medium', local.class)} {...rest} />\n}\n\nexport function CheckboxDescription(props: ComponentProps<typeof KobalteCheckbox.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteCheckbox.Description\n class={cn('text-muted-foreground text-sm', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":["Checkbox","KobalteCheckbox","Check","Minus","ComponentProps","JSX","splitProps","useFormFieldControl","cn","CheckboxProps","Omit","inputId","controlClass","labelClass","descriptionClass","label","Element","description","children","props","local","rest","field","id","_$createComponent","_$mergeProps","undefined","title","class","Input","aria-label","aria-labelledby","aria-describedby","aria-invalid","aria-errormessage","aria-busy","Control","Indicator","_$memo","indeterminate","_el$","_tmpl$","_$insert","_c$","Label","_c$2","Description","CheckboxLabel","CheckboxDescription","Checkbox","_$createComponent","KobalteCheckbox","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/checkbox/checkbox.tsx"],"sourcesContent":["import { Checkbox as KobalteCheckbox } from '@kobalte/core/checkbox'\nimport { Check, Minus } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\n/**\n * Checkbox.\n *\n * Three states: unchecked, checked, and indeterminate. Indeterminate is what a\n * \"select all\" box shows when only some rows are selected; Kobalte expresses\n * it through `checked=\"indeterminate\"` rather than a second boolean, so there\n * is no way to render a box that is both.\n *\n * The paint is `Control` and the value is a real hidden `Input`, so the control\n * participates in a form submission and in native validation while looking\n * nothing like a browser checkbox. Focus is tracked by the input, which is why\n * the ring lives on the control and reads the input's focus state.\n */\nexport type CheckboxProps = Omit<ComponentProps<typeof KobalteCheckbox>, 'children'> & {\n /** ID for the hidden native checkbox input; useful with an external label. */\n inputId?: string\n controlClass?: string\n labelClass?: string\n descriptionClass?: string\n label?: JSX.Element\n description?: JSX.Element\n /**\n * Replaces the control and label. Omit it to get the default control beside\n * `label` and `description`; supply it to compose the parts yourself.\n */\n children?: JSX.Element\n}\n\nexport function Checkbox(props: CheckboxProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'controlClass',\n 'labelClass',\n 'descriptionClass',\n 'children',\n 'label',\n 'description',\n 'indeterminate',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n 'aria-busy',\n 'id',\n 'inputId',\n 'title',\n ])\n const field = useFormFieldControl('control', {\n id: local.inputId ?? local.id,\n 'aria-label': local['aria-label'],\n 'aria-labelledby': local['aria-labelledby'],\n 'aria-describedby': local['aria-describedby'],\n 'aria-invalid': local['aria-invalid'],\n 'aria-errormessage': local['aria-errormessage'],\n })\n\n return (\n <KobalteCheckbox\n id={field ? undefined : local.id}\n title={local.title}\n class={cn('group/checkbox flex items-start gap-2.5', local.class)}\n {...rest}\n >\n {/*\n * The name goes on the input, which is what carries the value and takes\n * focus. On the Root it would land on a plain div and name nothing — the\n * box would announce its state with no subject.\n */}\n <KobalteCheckbox.Input\n id={field?.id ?? local.inputId}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n aria-busy={local['aria-busy']}\n title={local.title}\n />\n <KobalteCheckbox.Control\n class={cn(\n 'border-input bg-transparent flex size-4 shrink-0 items-center justify-center rounded-sm border',\n 'transition-[color,box-shadow,border-color,background-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'data-[checked]:bg-primary data-[checked]:border-primary data-[checked]:text-primary-foreground',\n 'data-[indeterminate]:bg-primary data-[indeterminate]:border-primary data-[indeterminate]:text-primary-foreground',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n local.controlClass\n )}\n >\n <KobalteCheckbox.Indicator class=\"flex items-center justify-center\">\n {local.indeterminate ? <Minus class=\"size-3\" /> : <Check class=\"size-3\" />}\n </KobalteCheckbox.Indicator>\n </KobalteCheckbox.Control>\n {local.children ??\n (local.label || local.description ? (\n <div class=\"grid gap-0.5\">\n {local.label ? (\n <KobalteCheckbox.Label class={cn('text-sm font-medium', local.labelClass)}>\n {local.label}\n </KobalteCheckbox.Label>\n ) : null}\n {local.description ? (\n <KobalteCheckbox.Description\n class={cn('text-muted-foreground text-sm', local.descriptionClass)}\n >\n {local.description}\n </KobalteCheckbox.Description>\n ) : null}\n </div>\n ) : null)}\n </KobalteCheckbox>\n )\n}\n\n/**\n * The box's own label. Valid only inside a `<Checkbox>`, for the same reason as\n * `SwitchLabel`: outside its root there is no control to associate with.\n */\nexport function CheckboxLabel(props: ComponentProps<typeof KobalteCheckbox.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteCheckbox.Label class={cn('text-sm font-medium', local.class)} {...rest} />\n}\n\nexport function CheckboxDescription(props: ComponentProps<typeof KobalteCheckbox.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteCheckbox.Description\n class={cn('text-muted-foreground text-sm', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;AAmCA,SAAgBA,WAASmB,OAAsB;CAC7C,MAAM,CAACC,OAAOC,QAAQf,WAAWa,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAO,CACR;CACD,MAAMG,QAAQf,oBAAoB,WAAW;EAC3CgB,IAAIH,MAAMT,WAAWS,MAAMG;EAC3B,cAAcH,MAAM;EACpB,mBAAmBA,MAAM;EACzB,oBAAoBA,MAAM;EAC1B,gBAAgBA,MAAM;EACtB,qBAAqBA,MAAM;CAC7B,CAAC;CAED,OAAAI,gBACGvB,UAAewB,WAAA;EAAA,IACdF,KAAE;GAAA,OAAED,QAAQI,KAAAA,IAAYN,MAAMG;EAAE;EAAA,IAChCI,QAAK;GAAA,OAAEP,MAAMO;EAAK;EAAA,KAAA,WAAA;GAAA,OACXnB,GAAG,2CAA2CY,MAAMQ,KAAK;EAAC;CAAA,GAC7DP,MAAI,EAAA,IAAAH,WAAA;EAAA,OAAA;GAAAM,gBAOPvB,SAAgB4B,OAAK;IAAA,IACpBN,KAAE;KAAA,OAAED,OAAOC,MAAMH,MAAMT;IAAO;IAAA,KAAA,gBAAA;KAAA,OAClBS,MAAM;IAAa;IAAA,KAAA,qBAAA;KAAA,OACdE,QAAQ,sBAAsBF,MAAM;IAAkB;IAAA,KAAA,sBAAA;KAAA,OACrDE,QAAQ,uBAAuBF,MAAM;IAAmB;IAAA,KAAA,kBAAA;KAAA,OAC5DE,QAAQ,mBAAmBF,MAAM;IAAe;IAAA,KAAA,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AAA;IAAA,OAAAuB;GAAA,EAAA,CAAA,IAER,KAAK;EAAA;CAAA,EAAA,CAAA,CAAA;AAGjB;;;;;AAMA,SAAgBO,cAAc5B,OAAqD;CACjF,MAAM,CAACC,OAAOC,QAAQf,WAAWa,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAK,gBAAQvB,SAAgB2C,OAAKnB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQjB,GAAG,uBAAuBY,MAAMQ,KAAK;CAAC,EAAA,GAAMP,IAAI,CAAA;AACvF;AAEA,SAAgB2B,oBAAoB7B,OAA2D;CAC7F,MAAM,CAACC,OAAOC,QAAQf,WAAWa,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAK,gBACGvB,SAAgB6C,aAAWrB,WAAA,EAAA,KAAA,WAAA;EAAA,OACnBjB,GAAG,iCAAiCY,MAAMQ,KAAK;CAAC,EAAA,GACnDP,IAAI,CAAA;AAGd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/combobox/combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/combobox/combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAM9C;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,KAAK,EAC/C,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,kCAGhE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,kCAgBpF;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,kCAmChF;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,kCAoBpF;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,kCAsBpF;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,kCAW9E;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,kCAGpF;AAED,sEAAsE;AACtE,wBAAgB,aAAa,CAAC,KAAK,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,kCAkB3E"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
2
|
import { menuItem, popoverArrow } from "../../../lib/overlay.js";
|
|
3
|
+
import { useFormFieldControl } from "../../../lib/form-field.js";
|
|
3
4
|
import { className, createComponent, delegateEvents, effect, insert, memo, mergeProps, template } from "solid-js/web";
|
|
4
5
|
import { Check, ChevronDown, X } from "lucide-solid";
|
|
5
6
|
import { Show, splitProps } from "solid-js";
|
|
@@ -29,10 +30,46 @@ function ComboboxControl(props) {
|
|
|
29
30
|
} }, rest));
|
|
30
31
|
}
|
|
31
32
|
function ComboboxInput(props) {
|
|
32
|
-
const [local, rest] = splitProps(props, [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
const [local, rest] = splitProps(props, [
|
|
34
|
+
"class",
|
|
35
|
+
"id",
|
|
36
|
+
"aria-label",
|
|
37
|
+
"aria-labelledby",
|
|
38
|
+
"aria-describedby",
|
|
39
|
+
"aria-invalid",
|
|
40
|
+
"aria-errormessage"
|
|
41
|
+
]);
|
|
42
|
+
const field = useFormFieldControl("control", {
|
|
43
|
+
id: local.id,
|
|
44
|
+
"aria-label": local["aria-label"],
|
|
45
|
+
"aria-labelledby": local["aria-labelledby"],
|
|
46
|
+
"aria-describedby": local["aria-describedby"],
|
|
47
|
+
"aria-invalid": local["aria-invalid"],
|
|
48
|
+
"aria-errormessage": local["aria-errormessage"]
|
|
49
|
+
});
|
|
50
|
+
return createComponent(Combobox.Input, mergeProps({
|
|
51
|
+
get id() {
|
|
52
|
+
return field?.id ?? local.id;
|
|
53
|
+
},
|
|
54
|
+
get ["aria-label"]() {
|
|
55
|
+
return local["aria-label"];
|
|
56
|
+
},
|
|
57
|
+
get ["aria-labelledby"]() {
|
|
58
|
+
return field?.["aria-labelledby"] ?? local["aria-labelledby"];
|
|
59
|
+
},
|
|
60
|
+
get ["aria-describedby"]() {
|
|
61
|
+
return field?.["aria-describedby"] ?? local["aria-describedby"];
|
|
62
|
+
},
|
|
63
|
+
get ["aria-invalid"]() {
|
|
64
|
+
return field?.["aria-invalid"] ?? local["aria-invalid"];
|
|
65
|
+
},
|
|
66
|
+
get ["aria-errormessage"]() {
|
|
67
|
+
return field?.["aria-errormessage"] ?? local["aria-errormessage"];
|
|
68
|
+
},
|
|
69
|
+
get ["class"]() {
|
|
70
|
+
return cn("h-full flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground", "disabled:cursor-not-allowed", local.class);
|
|
71
|
+
}
|
|
72
|
+
}, rest));
|
|
36
73
|
}
|
|
37
74
|
function ComboboxTrigger(props) {
|
|
38
75
|
const [local, rest] = splitProps(props, ["class", "children"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.js","names":["Combobox","KobalteCombobox","Check","ChevronDown","X","ComponentProps","Show","splitProps","menuContentPadding","menuItem","popoverArrow","cn","props","Option","OptGroup","_$createComponent","ComboboxControl","Control","local","rest","_$mergeProps","class","ComboboxInput","Input","ComboboxTrigger","Trigger","children","_$memo","Icon","ComboboxContent","Content","Portal","Listbox","Arrow","ComboboxItem","Item","ItemLabel","ItemIndicator","ComboboxSection","Section","ComboboxClear","onClear","when","_el$","_tmpl$","$$click","_$insert","_$effect","_$className","_$delegateEvents","Combobox","_$createComponent","KobalteCombobox","_$mergeProps","_$memo","_$className","_$delegateEvents"],"sources":["../../../../src/components/ui/combobox/combobox.tsx"],"sourcesContent":["import { Combobox as KobalteCombobox } from '@kobalte/core/combobox'\nimport { Check, ChevronDown, X } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { menuContentPadding, menuItem, popoverArrow } from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * Combobox.\n *\n * A Select whose list is filterable by typing. The difference from Select is\n * not cosmetic: a Combobox has a text input, so the user can narrow forty\n * options to one without reading the list. Above roughly ten options the\n * search is the feature; below it, a Select is quieter and a RadioGroup is\n * better still.\n *\n * Kobalte supplies the filtering, the `aria-activedescendant` wiring, the\n * keyboard selection and the multiple-selection mode, which is the part a\n * hand-rolled version reliably gets wrong.\n */\nexport function Combobox<Option, OptGroup = never>(\n props: ComponentProps<typeof KobalteCombobox<Option, OptGroup>>\n) {\n return <KobalteCombobox {...props} />\n}\n\nexport function ComboboxControl(props: ComponentProps<typeof KobalteCombobox.Control>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteCombobox.Control\n class={cn(\n 'border-input bg-transparent flex h-control-md w-full items-center gap-1.5 rounded-md border px-control-sm',\n 'transition-[color,box-shadow,border-color] ease-out',\n 'focus-within:border-ring focus-within:ring-3 focus-within:ring-primary-subtle',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function ComboboxInput(props: ComponentProps<typeof KobalteCombobox.Input>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteCombobox.Input\n class={cn(\n 'h-full flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function ComboboxTrigger(props: ComponentProps<typeof KobalteCombobox.Trigger>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Trigger\n class={cn(\n 'text-muted-foreground flex shrink-0 items-center justify-center rounded-sm outline-none',\n 'transition-colors ease-out hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <KobalteCombobox.Icon>\n <ChevronDown class=\"size-4\" />\n </KobalteCombobox.Icon>\n </KobalteCombobox.Trigger>\n )\n}\n\nexport function ComboboxContent(props: ComponentProps<typeof KobalteCombobox.Content>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Portal>\n <KobalteCombobox.Content\n class={cn(\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg',\n 'z-(--z-menu) max-h-72 min-w-(--kb-popper-anchor-width) origin-(--kb-combobox-content-transform-origin) overflow-hidden',\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n local.class\n )}\n {...rest}\n >\n <KobalteCombobox.Listbox class={cn('max-h-72 overflow-y-auto', menuContentPadding)} />\n {local.children}\n <KobalteCombobox.Arrow aria-hidden=\"true\" class={popoverArrow} />\n </KobalteCombobox.Content>\n </KobalteCombobox.Portal>\n )\n}\n\nexport function ComboboxItem(props: ComponentProps<typeof KobalteCombobox.Item>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Item class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <KobalteCombobox.ItemLabel>{local.children}</KobalteCombobox.ItemLabel>\n <KobalteCombobox.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Check class=\"size-4\" />\n </KobalteCombobox.ItemIndicator>\n </KobalteCombobox.Item>\n )\n}\n\nexport function ComboboxSection(props: ComponentProps<typeof KobalteCombobox.Section>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteCombobox.Section class={cn('flex flex-col', local.class)} {...rest} />\n}\n\n/** The clear affordance for a single-select Combobox with a value. */\nexport function ComboboxClear(props: { class?: string; onClear: () => void }) {\n return (\n <Show when={props.onClear}>\n <button\n type=\"button\"\n aria-label=\"Clear selection\"\n onClick={() => props.onClear()}\n class={cn(\n 'text-muted-foreground flex size-4 shrink-0 items-center justify-center rounded-sm',\n 'transition-colors ease-out outline-none hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n props.class\n )}\n >\n <X class=\"size-3.5\" />\n </button>\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoBA,SAAgBA,WACdY,OACA;CACA,OAAAG,gBAAQd,UAAoBW,KAAK;AACnC;AAEA,SAAgBI,gBAAgBJ,OAAuD;CACrF,MAAM,CAACM,OAAOC,QAAQZ,WAAWK,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAG,gBACGd,SAAgBgB,SAAOG,WAAA,EAAA,KAAA,WAAA;EAAA,OACfT,GACL,6GACA,uDACA,iFACA,kGACA,iEACAO,MAAMG,KACR;CAAC,EAAA,GACGF,IAAI,CAAA;AAGd;AAEA,SAAgBG,cAAcV,OAAqD;CACjF,MAAM,CAACM,OAAOC,QAAQZ,WAAWK,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAG,gBACGd,SAAgBsB,OAAKH,WAAA,EAAA,KAAA,WAAA;EAAA,OACbT,GACL,uFACA,+BACAO,MAAMG,KACR;CAAC,EAAA,GACGF,IAAI,CAA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A;EAAA,OAAQT,GAAGF,UAAU,QAAQS,MAAMG,KAAK;CAAC,EAAA,GAAMF,MAAI,EAAA,IAAAO,WAAA;EAAA,OAAA,CAAAX,gBACrEd,SAAgBmC,WAAS,EAAA,IAAAV,WAAA;GAAA,OAAER,MAAMQ;EAAQ,EAAA,CAAA,GAAAX,gBACzCd,SAAgBoC,eAAa;GAAA,SAAA;GAAA,IAAAX,WAAA;IAAA,OAAAX,gBAC3Bb,OAAK,EAAA,SAAA,SAAA,CAAA;GAAA;EAAA,CAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAId;AAEA,SAAgBoC,gBAAgB1B,OAAuD;CACrF,MAAM,CAACM,OAAOC,QAAQZ,WAAWK,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQd,SAAgBsC,SAAOnB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQT,GAAG,iBAAiBO,MAAMG,KAAK;CAAC,EAAA,GAAMF,IAAI,CAAA;AACnF;;AAGA,SAAgBqB,cAAc5B,OAAgD;CAC5E,OAAAG,gBACGT,MAAI;EAAA,IAACoC,OAAI;GAAA,OAAE9B,MAAM6B;EAAO;EAAA,IAAAf,WAAA;GAAA,IAAAiB,OAAAC,OAAA;GAAAD,KAAAE,gBAINjC,MAAM6B,QAAQ;GAACK,OAAAH,MAAA5B,gBAQ7BX,GAAC,EAAA,SAAA,WAAA,CAAA,CAAA;GAAA2C,aAAAC,UAAAL,MAPKhC,GACL,qFACA,iEACA,oFACAC,MAAMS,KACR,CAAC,CAAA;GAAA,OAAAsB;EAAA;CAAA,CAAA;AAMT;AAACM,eAAA,CAAA,OAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"combobox.js","names":["Combobox","KobalteCombobox","Check","ChevronDown","X","ComponentProps","Show","splitProps","menuContentPadding","menuItem","popoverArrow","useFormFieldControl","cn","props","Option","OptGroup","_$createComponent","ComboboxControl","Control","local","rest","_$mergeProps","class","ComboboxInput","Input","field","id","aria-label","aria-labelledby","aria-describedby","aria-invalid","aria-errormessage","ComboboxTrigger","Trigger","children","_$memo","Icon","ComboboxContent","Content","Portal","Listbox","Arrow","ComboboxItem","Item","ItemLabel","ItemIndicator","ComboboxSection","Section","ComboboxClear","onClear","when","_el$","_tmpl$","$$click","_$insert","_$effect","_$className","_$delegateEvents","Combobox","_$createComponent","KobalteCombobox","_$mergeProps","_$memo","_$className","_$delegateEvents"],"sources":["../../../../src/components/ui/combobox/combobox.tsx"],"sourcesContent":["import { Combobox as KobalteCombobox } from '@kobalte/core/combobox'\nimport { Check, ChevronDown, X } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { menuContentPadding, menuItem, popoverArrow } from '#lib/overlay'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\n/**\n * Combobox.\n *\n * A Select whose list is filterable by typing. The difference from Select is\n * not cosmetic: a Combobox has a text input, so the user can narrow forty\n * options to one without reading the list. Above roughly ten options the\n * search is the feature; below it, a Select is quieter and a RadioGroup is\n * better still.\n *\n * Kobalte supplies the filtering, the `aria-activedescendant` wiring, the\n * keyboard selection and the multiple-selection mode, which is the part a\n * hand-rolled version reliably gets wrong.\n */\nexport function Combobox<Option, OptGroup = never>(\n props: ComponentProps<typeof KobalteCombobox<Option, OptGroup>>\n) {\n return <KobalteCombobox {...props} />\n}\n\nexport function ComboboxControl(props: ComponentProps<typeof KobalteCombobox.Control>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteCombobox.Control\n class={cn(\n 'border-input bg-transparent flex h-control-md w-full items-center gap-1.5 rounded-md border px-control-sm',\n 'transition-[color,box-shadow,border-color] ease-out',\n 'focus-within:border-ring focus-within:ring-3 focus-within:ring-primary-subtle',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function ComboboxInput(props: ComponentProps<typeof KobalteCombobox.Input>) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n ])\n const field = useFormFieldControl('control', {\n id: local.id,\n 'aria-label': local['aria-label'],\n 'aria-labelledby': local['aria-labelledby'],\n 'aria-describedby': local['aria-describedby'],\n 'aria-invalid': local['aria-invalid'],\n 'aria-errormessage': local['aria-errormessage'],\n })\n\n return (\n <KobalteCombobox.Input\n id={field?.id ?? local.id}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n class={cn(\n 'h-full flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground',\n 'disabled:cursor-not-allowed',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function ComboboxTrigger(props: ComponentProps<typeof KobalteCombobox.Trigger>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Trigger\n class={cn(\n 'text-muted-foreground flex shrink-0 items-center justify-center rounded-sm outline-none',\n 'transition-colors ease-out hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <KobalteCombobox.Icon>\n <ChevronDown class=\"size-4\" />\n </KobalteCombobox.Icon>\n </KobalteCombobox.Trigger>\n )\n}\n\nexport function ComboboxContent(props: ComponentProps<typeof KobalteCombobox.Content>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Portal>\n <KobalteCombobox.Content\n class={cn(\n 'bg-popover text-popover-foreground rounded-xl border border-border shadow-lg',\n 'z-(--z-menu) max-h-72 min-w-(--kb-popper-anchor-width) origin-(--kb-combobox-content-transform-origin) overflow-hidden',\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n local.class\n )}\n {...rest}\n >\n <KobalteCombobox.Listbox class={cn('max-h-72 overflow-y-auto', menuContentPadding)} />\n {local.children}\n <KobalteCombobox.Arrow aria-hidden=\"true\" class={popoverArrow} />\n </KobalteCombobox.Content>\n </KobalteCombobox.Portal>\n )\n}\n\nexport function ComboboxItem(props: ComponentProps<typeof KobalteCombobox.Item>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteCombobox.Item class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <KobalteCombobox.ItemLabel>{local.children}</KobalteCombobox.ItemLabel>\n <KobalteCombobox.ItemIndicator class=\"absolute end-2 flex size-4 items-center justify-center\">\n <Check class=\"size-4\" />\n </KobalteCombobox.ItemIndicator>\n </KobalteCombobox.Item>\n )\n}\n\nexport function ComboboxSection(props: ComponentProps<typeof KobalteCombobox.Section>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteCombobox.Section class={cn('flex flex-col', local.class)} {...rest} />\n}\n\n/** The clear affordance for a single-select Combobox with a value. */\nexport function ComboboxClear(props: { class?: string; onClear: () => void }) {\n return (\n <Show when={props.onClear}>\n <button\n type=\"button\"\n aria-label=\"Clear selection\"\n onClick={() => props.onClear()}\n class={cn(\n 'text-muted-foreground flex size-4 shrink-0 items-center justify-center rounded-sm',\n 'transition-colors ease-out outline-none hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n props.class\n )}\n >\n <X class=\"size-3.5\" />\n </button>\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAgBA,WACda,OACA;CACA,OAAAG,gBAAQf,UAAoBY,KAAK;AACnC;AAE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CAAA,GAAAlB,gBACzCf,SAAgB4C,eAAa;GAAA,SAAA;GAAA,IAAAX,WAAA;IAAA,OAAAlB,gBAC3Bd,OAAK,EAAA,SAAA,SAAA,CAAA;GAAA;EAAA,CAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAId;AAEA,SAAgB4C,gBAAgBjC,OAAuD;CACrF,MAAM,CAACM,OAAOC,QAAQb,WAAWM,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQf,SAAgB8C,SAAO1B,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQT,GAAG,iBAAiBO,MAAMG,KAAK;CAAC,EAAA,GAAMF,IAAI,CAAA;AACnF;;AAGA,SAAgB4B,cAAcnC,OAAgD;CAC5E,OAAAG,gBACGV,MAAI;EAAA,IAAC4C,OAAI;GAAA,OAAErC,MAAMoC;EAAO;EAAA,IAAAf,WAAA;GAAA,IAAAiB,OAAAC,OAAA;GAAAD,KAAAE,gBAINxC,MAAMoC,QAAQ;GAACK,OAAAH,MAAAnC,gBAQ7BZ,GAAC,EAAA,SAAA,WAAA,CAAA,CAAA;GAAAmD,aAAAC,UAAAL,MAPKvC,GACL,qFACA,iEACA,oFACAC,MAAMS,KACR,CAAC,CAAA;GAAA,OAAA6B;EAAA;CAAA,CAAA;AAMT;AAACM,eAAA,CAAA,OAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/combobox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,aAAa,EACb,eAAe,EACf,eAAe,EACf,aAAa,EACb,YAAY,EACZ,eAAe,EACf,eAAe,GAChB,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/combobox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,aAAa,EACb,eAAe,EACf,eAAe,EACf,aAAa,EACb,YAAY,EACZ,eAAe,EACf,eAAe,GAChB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { Combobox, ComboboxClear, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxSection, ComboboxTrigger } from "./combobox.js";
|
|
2
|
-
|
|
2
|
+
import { ValueCombobox } from "./value-combobox.js";
|
|
3
|
+
export { Combobox, ComboboxClear, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxSection, ComboboxTrigger, ValueCombobox };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ComponentProps, type JSX } from 'solid-js';
|
|
2
|
+
import { ComboboxInput } from './combobox';
|
|
3
|
+
export type ValueComboboxChoice = {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string | number;
|
|
6
|
+
textValue?: string;
|
|
7
|
+
} | {
|
|
8
|
+
value: string;
|
|
9
|
+
label: JSX.Element;
|
|
10
|
+
textValue: string;
|
|
11
|
+
};
|
|
12
|
+
export type ValueComboboxProps = Omit<ComponentProps<typeof ComboboxInput>, 'value'> & {
|
|
13
|
+
value: string;
|
|
14
|
+
choices: ValueComboboxChoice[];
|
|
15
|
+
onValueChange: (value: string) => void;
|
|
16
|
+
};
|
|
17
|
+
/** A single-choice combobox for a controlled string value and labelled choices. */
|
|
18
|
+
export declare function ValueCombobox(props: ValueComboboxProps): JSX.Element;
|
|
19
|
+
//# sourceMappingURL=value-combobox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-combobox.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/combobox/value-combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AACpE,OAAO,EAA6B,aAAa,EAAgB,MAAM,YAAY,CAAA;AAEnF,MAAM,MAAM,mBAAmB,GAC3B;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7D;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAA;AAE5D,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,EAAE,OAAO,CAAC,GAAG;IACrF,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,mBAAmB,EAAE,CAAA;IAC9B,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACvC,CAAA;AAED,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,eAmBtD"}
|