@manakind/ui-core 0.17.1 → 0.18.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 +2 -0
- package/dist/combobox/combobox.css +155 -0
- package/dist/combobox/combobox.css.d.ts +2 -0
- package/dist/combobox/combobox.d.ts +84 -0
- package/dist/combobox/combobox.d.ts.map +1 -0
- package/dist/combobox/combobox.js +70 -0
- package/dist/combobox/combobox.js.map +1 -0
- package/dist/combobox/index.d.ts +3 -0
- package/dist/combobox/index.d.ts.map +1 -0
- package/dist/combobox/index.js +2 -0
- package/dist/combobox/index.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -68,6 +68,7 @@ separately, so an app can load only what it renders.
|
|
|
68
68
|
| `@manakind/ui-core/menu` | `Menu`, `MenuTrigger` |
|
|
69
69
|
| `@manakind/ui-core/popover` | `Popover` |
|
|
70
70
|
| `@manakind/ui-core/checkbox` | `Checkbox` |
|
|
71
|
+
| `@manakind/ui-core/combobox` | `Combobox` |
|
|
71
72
|
| `@manakind/ui-core/date-input` | `DateInput` |
|
|
72
73
|
| `@manakind/ui-core/progress` | `Progress` |
|
|
73
74
|
| `@manakind/ui-core/reorder-control` | `ReorderControl` |
|
|
@@ -87,6 +88,7 @@ separately, so an app can load only what it renders.
|
|
|
87
88
|
| `@manakind/ui-core/css/menu` | Menu structural CSS |
|
|
88
89
|
| `@manakind/ui-core/css/popover` | Popover structural CSS |
|
|
89
90
|
| `@manakind/ui-core/css/checkbox` | Checkbox structural CSS |
|
|
91
|
+
| `@manakind/ui-core/css/combobox` | Combobox structural CSS |
|
|
90
92
|
| `@manakind/ui-core/css/date-input` | DateInput structural CSS |
|
|
91
93
|
| `@manakind/ui-core/css/progress` | Progress structural CSS |
|
|
92
94
|
| `@manakind/ui-core/css/reorder-control` | ReorderControl structural CSS; its handle and input also need `css/button`, `css/icon` and `css/field` |
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
/*
|
|
3
|
+
* The list renders in a portal, so it is not a descendant of `.ds-combobox`
|
|
4
|
+
* and is styled at the top level. It reads the `--ds-select-*` keys: an
|
|
5
|
+
* open list of options is the same surface whichever control opened it.
|
|
6
|
+
*
|
|
7
|
+
* Ark marks the closed list with `hidden`; any author `display` beats the
|
|
8
|
+
* UA's `[hidden] { display: none }`, so the pair below stays together (the
|
|
9
|
+
* same trap `select.css` documents).
|
|
10
|
+
*/
|
|
11
|
+
.ds-combobox__content[hidden] {
|
|
12
|
+
display: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ds-combobox__content {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
padding: var(--ds-select-content-padding);
|
|
19
|
+
border: 1px solid var(--ds-select-content-border);
|
|
20
|
+
border-radius: var(--ds-select-content-radius);
|
|
21
|
+
background-color: var(--ds-select-content-bg);
|
|
22
|
+
max-height: 20rem;
|
|
23
|
+
overflow-y: auto;
|
|
24
|
+
overflow-wrap: anywhere;
|
|
25
|
+
/* The `popup` layer in ds-config/scripts/stacking.ts, as Select's list. */
|
|
26
|
+
z-index: 60;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.ds-combobox__item {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
padding: var(--ds-select-item-padding-block) var(--ds-select-item-padding-inline);
|
|
33
|
+
/* Nested radius, derived the same way as Select's items. */
|
|
34
|
+
border-radius: max(
|
|
35
|
+
0px,
|
|
36
|
+
calc(var(--ds-select-content-radius) - var(--ds-select-content-padding) - 1px)
|
|
37
|
+
);
|
|
38
|
+
color: var(--ds-select-item-text);
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
|
|
41
|
+
&[data-highlighted] {
|
|
42
|
+
background-color: var(--ds-select-item-bg-highlighted);
|
|
43
|
+
color: var(--ds-select-item-text-highlighted);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&[data-disabled] {
|
|
47
|
+
opacity: var(--ds-opacity-disabled);
|
|
48
|
+
cursor: not-allowed;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.ds-combobox__item-description {
|
|
53
|
+
color: var(--ds-field-hint-text);
|
|
54
|
+
font-size: var(--ds-field-hint-font-size);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
* A highlighted row takes the highlighted text colour, which the hint
|
|
59
|
+
* colour was never measured against; the description follows the row.
|
|
60
|
+
*/
|
|
61
|
+
.ds-combobox__item[data-highlighted] .ds-combobox__item-description {
|
|
62
|
+
color: inherit;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.ds-combobox__empty {
|
|
66
|
+
padding: var(--ds-select-item-padding-block) var(--ds-select-item-padding-inline);
|
|
67
|
+
color: var(--ds-field-hint-text);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.ds-combobox {
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
gap: var(--ds-field-gap);
|
|
74
|
+
overflow-wrap: anywhere;
|
|
75
|
+
|
|
76
|
+
& .ds-combobox__label {
|
|
77
|
+
color: var(--ds-field-label-text);
|
|
78
|
+
font-size: var(--ds-field-label-font-size);
|
|
79
|
+
font-weight: var(--ds-field-label-font-weight);
|
|
80
|
+
|
|
81
|
+
&[data-disabled] {
|
|
82
|
+
opacity: var(--ds-opacity-disabled);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* The input is `Input`'s: the same keys and the same state signals. */
|
|
87
|
+
& .ds-combobox__input {
|
|
88
|
+
display: block;
|
|
89
|
+
box-sizing: border-box;
|
|
90
|
+
width: 100%;
|
|
91
|
+
border: 1px solid var(--ds-input-border);
|
|
92
|
+
border-radius: var(--ds-input-radius);
|
|
93
|
+
background-color: var(--ds-input-bg);
|
|
94
|
+
color: var(--ds-input-text);
|
|
95
|
+
font-family: inherit;
|
|
96
|
+
font-weight: inherit;
|
|
97
|
+
line-height: inherit;
|
|
98
|
+
transition:
|
|
99
|
+
background-color 150ms cubic-bezier(0, 0, 0.2, 1),
|
|
100
|
+
border-color 150ms cubic-bezier(0, 0, 0.2, 1),
|
|
101
|
+
box-shadow 150ms cubic-bezier(0, 0, 0.2, 1);
|
|
102
|
+
|
|
103
|
+
&::placeholder {
|
|
104
|
+
color: var(--ds-input-placeholder);
|
|
105
|
+
opacity: 100%;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&[data-invalid] {
|
|
109
|
+
border-color: var(--ds-input-border-invalid);
|
|
110
|
+
box-shadow: 0 0 0 1px var(--ds-input-border-invalid);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&:hover:not(:disabled) {
|
|
114
|
+
background-color: var(--ds-input-bg-hover);
|
|
115
|
+
|
|
116
|
+
&:not([data-invalid]) {
|
|
117
|
+
border-color: var(--ds-input-border-hover);
|
|
118
|
+
box-shadow: 0 0 0 1px var(--ds-input-border-hover);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&:focus-visible {
|
|
123
|
+
outline: 2px solid var(--ds-input-focus-ring);
|
|
124
|
+
outline-offset: 3px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&:disabled {
|
|
128
|
+
opacity: var(--ds-opacity-disabled);
|
|
129
|
+
cursor: not-allowed;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/*
|
|
134
|
+
* Single-line, so no block padding: like `Input`, the text centres in the
|
|
135
|
+
* control height, which keeps the field level with a Select beside it.
|
|
136
|
+
*/
|
|
137
|
+
&.ds-combobox--sm .ds-combobox__input {
|
|
138
|
+
min-height: var(--ds-input-size-sm-height);
|
|
139
|
+
padding-inline: var(--ds-input-size-sm-padding-inline);
|
|
140
|
+
font-size: var(--ds-input-size-sm-font-size);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&.ds-combobox--md .ds-combobox__input {
|
|
144
|
+
min-height: var(--ds-input-size-md-height);
|
|
145
|
+
padding-inline: var(--ds-input-size-md-padding-inline);
|
|
146
|
+
font-size: var(--ds-input-size-md-font-size);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&.ds-combobox--lg .ds-combobox__input {
|
|
150
|
+
min-height: var(--ds-input-size-lg-height);
|
|
151
|
+
padding-inline: var(--ds-input-size-lg-padding-inline);
|
|
152
|
+
font-size: var(--ds-input-size-lg-font-size);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type ReactNode, type Ref } from 'react';
|
|
2
|
+
import './combobox.css';
|
|
3
|
+
export type ComboboxSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
export interface ComboboxItem {
|
|
5
|
+
/** Stable value reported by `onSelect`. */
|
|
6
|
+
value: string;
|
|
7
|
+
/** Option text, also what typeahead and screen readers use. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Optional secondary line under the label, shown muted. */
|
|
10
|
+
description?: string;
|
|
11
|
+
/** Individually disable this option without removing it. */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface ComboboxProps {
|
|
15
|
+
/**
|
|
16
|
+
* Suggestions for the current text.
|
|
17
|
+
*
|
|
18
|
+
* The caller filters them; the component does not. What counts as a match
|
|
19
|
+
* (a prefix, a substring, anything not already chosen) is the product's
|
|
20
|
+
* call, and the list it passes is the list that shows.
|
|
21
|
+
*/
|
|
22
|
+
items: ComboboxItem[];
|
|
23
|
+
/** Controlled text in the input. */
|
|
24
|
+
inputValue: string;
|
|
25
|
+
/** Fired with the new text on every keystroke, and with `''` after a choice. */
|
|
26
|
+
onInputValueChange: (value: string) => void;
|
|
27
|
+
/**
|
|
28
|
+
* A suggestion was chosen. The input then clears (`onInputValueChange('')`)
|
|
29
|
+
* and the field holds no value: this is the "add to a list" pattern. A
|
|
30
|
+
* field that keeps its choice is a `Select`.
|
|
31
|
+
*/
|
|
32
|
+
onSelect: (value: string) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Visible label. Strongly preferred over `aria-label` — a visible label
|
|
35
|
+
* helps everyone, not only screen reader users.
|
|
36
|
+
*/
|
|
37
|
+
label?: ReactNode;
|
|
38
|
+
/** Accessible name when no visible `label` is supplied. */
|
|
39
|
+
'aria-label'?: string;
|
|
40
|
+
/** Text shown in the empty input. */
|
|
41
|
+
placeholder?: string;
|
|
42
|
+
/** Shown in the open list when `items` is empty. */
|
|
43
|
+
emptyText?: ReactNode;
|
|
44
|
+
/** Control height and type scale. */
|
|
45
|
+
size?: ComboboxSize;
|
|
46
|
+
/** Disable the whole control. */
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
/** Marks the field invalid for assistive tech and styling. */
|
|
49
|
+
invalid?: boolean;
|
|
50
|
+
/** Extra class names appended after `ds-combobox` modifiers. */
|
|
51
|
+
className?: string;
|
|
52
|
+
/** The text input, for moving focus back to the field, e.g. after removing an item it added. */
|
|
53
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A text input that suggests options as you type, built on Ark UI.
|
|
57
|
+
*
|
|
58
|
+
* Choosing a suggestion reports it through `onSelect` and empties the input,
|
|
59
|
+
* so the field is ready for the next one: the control for adding items to a
|
|
60
|
+
* list one at a time. It never holds a selection itself; the caller keeps
|
|
61
|
+
* the list. For a field that keeps one choice, use `Select`.
|
|
62
|
+
*
|
|
63
|
+
* Ark owns the combobox semantics, keyboard navigation (the first suggestion
|
|
64
|
+
* is highlighted as you type, so Enter takes it) and dismiss behaviour. This
|
|
65
|
+
* wrapper contributes `ds-` classes, binds the input to the `--ds-input-*`
|
|
66
|
+
* keys and the list to the `--ds-select-*` keys, so it reads as one family
|
|
67
|
+
* with `Input` and `Select`, and offers a flat `items` API.
|
|
68
|
+
*
|
|
69
|
+
* ```tsx
|
|
70
|
+
* <Combobox
|
|
71
|
+
* label="Add an action"
|
|
72
|
+
* items={matches}
|
|
73
|
+
* inputValue={query}
|
|
74
|
+
* onInputValueChange={setQuery}
|
|
75
|
+
* onSelect={(value) => setPicked((list) => [...list, value])}
|
|
76
|
+
* emptyText="No matching actions"
|
|
77
|
+
* />
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* The list portals like `Select`'s: into `<body>`, or into the panel of the
|
|
81
|
+
* ui-core `Dialog` it opens in, at `z-index: 60`.
|
|
82
|
+
*/
|
|
83
|
+
export declare function Combobox({ items, inputValue, onInputValueChange, onSelect, label, 'aria-label': ariaLabel, placeholder, emptyText, size, disabled, invalid, className, inputRef, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
|
|
84
|
+
//# sourceMappingURL=combobox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../src/combobox/combobox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAoC,MAAM,OAAO,CAAC;AAGnF,OAAO,gBAAgB,CAAC;AAGxB,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C,MAAM,WAAW,YAAY;IAC3B,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C;;;;OAIG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,qCAAqC;IACrC,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gGAAgG;IAChG,QAAQ,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAClC;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,UAAU,EACV,kBAAkB,EAClB,QAAQ,EACR,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,WAAW,EACX,SAAS,EACT,IAAW,EACX,QAAQ,EACR,OAAO,EACP,SAAS,EACT,QAAQ,GACT,EAAE,aAAa,2CA6Ff"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Combobox as ArkCombobox, createListCollection } from '@ark-ui/react/combobox';
|
|
3
|
+
import { Portal } from '@ark-ui/react/portal';
|
|
4
|
+
import { useCallback, useContext, useMemo } from 'react';
|
|
5
|
+
import { flushSync } from 'react-dom';
|
|
6
|
+
import { PortalContainerContext } from '../portal-container';
|
|
7
|
+
import './combobox.css';
|
|
8
|
+
import { cx } from '../cx';
|
|
9
|
+
const NO_VALUE = [];
|
|
10
|
+
/**
|
|
11
|
+
* A text input that suggests options as you type, built on Ark UI.
|
|
12
|
+
*
|
|
13
|
+
* Choosing a suggestion reports it through `onSelect` and empties the input,
|
|
14
|
+
* so the field is ready for the next one: the control for adding items to a
|
|
15
|
+
* list one at a time. It never holds a selection itself; the caller keeps
|
|
16
|
+
* the list. For a field that keeps one choice, use `Select`.
|
|
17
|
+
*
|
|
18
|
+
* Ark owns the combobox semantics, keyboard navigation (the first suggestion
|
|
19
|
+
* is highlighted as you type, so Enter takes it) and dismiss behaviour. This
|
|
20
|
+
* wrapper contributes `ds-` classes, binds the input to the `--ds-input-*`
|
|
21
|
+
* keys and the list to the `--ds-select-*` keys, so it reads as one family
|
|
22
|
+
* with `Input` and `Select`, and offers a flat `items` API.
|
|
23
|
+
*
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <Combobox
|
|
26
|
+
* label="Add an action"
|
|
27
|
+
* items={matches}
|
|
28
|
+
* inputValue={query}
|
|
29
|
+
* onInputValueChange={setQuery}
|
|
30
|
+
* onSelect={(value) => setPicked((list) => [...list, value])}
|
|
31
|
+
* emptyText="No matching actions"
|
|
32
|
+
* />
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* The list portals like `Select`'s: into `<body>`, or into the panel of the
|
|
36
|
+
* ui-core `Dialog` it opens in, at `z-index: 60`.
|
|
37
|
+
*/
|
|
38
|
+
export function Combobox({ items, inputValue, onInputValueChange, onSelect, label, 'aria-label': ariaLabel, placeholder, emptyText, size = 'md', disabled, invalid, className, inputRef, }) {
|
|
39
|
+
const collection = useMemo(() => createListCollection({
|
|
40
|
+
items,
|
|
41
|
+
itemToValue: (item) => item.value,
|
|
42
|
+
itemToString: (item) => item.label,
|
|
43
|
+
isItemDisabled: (item) => item.disabled ?? false,
|
|
44
|
+
}), [items]);
|
|
45
|
+
const portalContainer = useContext(PortalContainerContext);
|
|
46
|
+
/*
|
|
47
|
+
* An option, not Ark's `Empty` (role="presentation"): a listbox with no
|
|
48
|
+
* option in it fails axe's aria-required-children, and a disabled option
|
|
49
|
+
* is how a screen reader hears that nothing matched — the pattern GOV.UK's
|
|
50
|
+
* accessible-autocomplete uses. Zag navigates by its collection, so it
|
|
51
|
+
* never lands on this row.
|
|
52
|
+
*/
|
|
53
|
+
const emptyOption = items.length === 0 && emptyText !== undefined && (_jsx("div", { role: "option", "aria-disabled": "true", "aria-selected": "false", className: "ds-combobox__empty", children: emptyText }));
|
|
54
|
+
const handleValueChange = useCallback((details) => {
|
|
55
|
+
const chosen = details.value[0];
|
|
56
|
+
if (chosen !== undefined)
|
|
57
|
+
onSelect(chosen);
|
|
58
|
+
}, [onSelect]);
|
|
59
|
+
/*
|
|
60
|
+
* Flushed, so the new text is rendered before the next keystroke arrives.
|
|
61
|
+
* Zag writes the input's value back from its state after every change; left
|
|
62
|
+
* to React's scheduler, that render could land after a later keystroke and
|
|
63
|
+
* overwrite it ("vis" then "a" came out as "via"), which a fast typist or a
|
|
64
|
+
* busy page can trigger, since browsers run input events ahead of other
|
|
65
|
+
* tasks.
|
|
66
|
+
*/
|
|
67
|
+
const handleInputValueChange = useCallback((details) => flushSync(() => onInputValueChange(details.inputValue)), [onInputValueChange]);
|
|
68
|
+
return (_jsxs(ArkCombobox.Root, { collection: collection, className: cx('ds-combobox', `ds-combobox--${size}`, className), value: NO_VALUE, onValueChange: handleValueChange, inputValue: inputValue, onInputValueChange: handleInputValueChange, selectionBehavior: "clear", inputBehavior: "autohighlight", openOnClick: true, disabled: disabled, invalid: invalid, positioning: { sameWidth: true }, children: [label && _jsx(ArkCombobox.Label, { className: "ds-combobox__label", children: label }), _jsx(ArkCombobox.Control, { children: _jsx(ArkCombobox.Input, { ref: inputRef, className: "ds-combobox__input", placeholder: placeholder, "aria-label": ariaLabel }) }), _jsx(Portal, { container: portalContainer, children: _jsx(ArkCombobox.Positioner, { children: _jsxs(ArkCombobox.Content, { className: "ds-combobox__content", children: [items.map((item) => (_jsxs(ArkCombobox.Item, { item: item, className: "ds-combobox__item", children: [_jsx(ArkCombobox.ItemText, { className: "ds-combobox__item-label", children: item.label }), item.description && (_jsx("span", { className: "ds-combobox__item-description", children: item.description }))] }, item.value))), emptyOption] }) }) })] }));
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=combobox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox.js","sourceRoot":"","sources":["../../src/combobox/combobox.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/combobox/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/combobox/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,KAAK,IAAI,aAAa,EACtB,WAAW,IAAI,mBAAmB,EAClC,YAAY,IAAI,oBAAoB,EACpC,KAAK,IAAI,aAAa,GACvB,MAAM,mBAAmB,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,KAAK,IAAI,aAAa,EACtB,WAAW,IAAI,mBAAmB,EAClC,YAAY,IAAI,oBAAoB,EACpC,KAAK,IAAI,aAAa,GACvB,MAAM,mBAAmB,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,KAAK,IAAI,aAAa,EACtB,WAAW,IAAI,mBAAmB,EAClC,YAAY,IAAI,oBAAoB,EACpC,KAAK,IAAI,aAAa,GACvB,MAAM,mBAAmB,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,KAAK,IAAI,aAAa,EACtB,WAAW,IAAI,mBAAmB,EAClC,YAAY,IAAI,oBAAoB,EACpC,KAAK,IAAI,aAAa,GACvB,MAAM,mBAAmB,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manakind/ui-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -48,6 +48,10 @@
|
|
|
48
48
|
"types": "./dist/checkbox/index.d.ts",
|
|
49
49
|
"import": "./dist/checkbox/index.js"
|
|
50
50
|
},
|
|
51
|
+
"./combobox": {
|
|
52
|
+
"types": "./dist/combobox/index.d.ts",
|
|
53
|
+
"import": "./dist/combobox/index.js"
|
|
54
|
+
},
|
|
51
55
|
"./date-input": {
|
|
52
56
|
"types": "./dist/date-input/index.d.ts",
|
|
53
57
|
"import": "./dist/date-input/index.js"
|
|
@@ -124,6 +128,10 @@
|
|
|
124
128
|
"types": "./dist/checkbox/checkbox.css.d.ts",
|
|
125
129
|
"default": "./dist/checkbox/checkbox.css"
|
|
126
130
|
},
|
|
131
|
+
"./css/combobox": {
|
|
132
|
+
"types": "./dist/combobox/combobox.css.d.ts",
|
|
133
|
+
"default": "./dist/combobox/combobox.css"
|
|
134
|
+
},
|
|
127
135
|
"./css/date-input": {
|
|
128
136
|
"types": "./dist/date-input/date-input.css.d.ts",
|
|
129
137
|
"default": "./dist/date-input/date-input.css"
|