tembro 2.1.7 → 2.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/form/form-date-range-input.cjs +1 -1
- package/dist/components/form/form-date-range-input.d.ts +1 -1
- package/dist/components/form/form-date-range-input.js +1 -1
- package/dist/components/form/form-input.cjs +1 -1
- package/dist/components/form/form-input.d.ts +7 -7
- package/dist/components/form/form-input.js +11 -11
- package/dist/components/inputs/index.cjs +1 -1
- package/dist/components/inputs/index.d.ts +0 -14
- package/dist/components/inputs/index.js +9 -23
- package/dist/components/inputs/public.cjs +1 -1
- package/dist/components/inputs/public.d.ts +0 -14
- package/dist/components/inputs/public.js +9 -23
- package/dist/components/ui/input/chrome.cjs +1 -0
- package/dist/components/{inputs/input-chrome.js → ui/input/chrome.js} +2 -2
- package/dist/components/ui/input/clearable.cjs +1 -0
- package/dist/components/{inputs/clearable-input.d.ts → ui/input/clearable.d.ts} +1 -1
- package/dist/components/{inputs/clearable-input.js → ui/input/clearable.js} +4 -4
- package/dist/components/{inputs/date-range-input.cjs → ui/input/date-range.cjs} +1 -1
- package/dist/components/{inputs/date-range-input.d.ts → ui/input/date-range.d.ts} +1 -1
- package/dist/components/{inputs/date-range-input.js → ui/input/date-range.js} +3 -3
- package/dist/components/ui/input/date.cjs +1 -0
- package/dist/components/{inputs/date-input.d.ts → ui/input/date.d.ts} +1 -1
- package/dist/components/{inputs/date-input.js → ui/input/date.js} +3 -3
- package/dist/components/ui/input/decorator.cjs +1 -0
- package/dist/components/{inputs/input-decorator.js → ui/input/decorator.js} +3 -3
- package/dist/components/ui/input/index.cjs +1 -1
- package/dist/components/ui/input/index.d.ts +10 -10
- package/dist/components/ui/input/index.js +13 -13
- package/dist/components/ui/input/masked.cjs +1 -0
- package/dist/components/{inputs/masked-input.d.ts → ui/input/masked.d.ts} +1 -1
- package/dist/components/{inputs/masked-input.js → ui/input/masked.js} +3 -3
- package/dist/components/ui/input/money.cjs +1 -0
- package/dist/components/{inputs/money-input.js → ui/input/money.js} +5 -5
- package/dist/components/ui/input/number.cjs +1 -0
- package/dist/components/{inputs/number-input.d.ts → ui/input/number.d.ts} +1 -1
- package/dist/components/{inputs/number-input.js → ui/input/number.js} +3 -3
- package/dist/components/{inputs → ui/input}/numeric-value.js +1 -1
- package/dist/components/ui/input/password.cjs +1 -0
- package/dist/components/{inputs/password-input.d.ts → ui/input/password.d.ts} +1 -1
- package/dist/components/{inputs/password-input.js → ui/input/password.js} +2 -2
- package/dist/components/ui/input/phone.cjs +1 -0
- package/dist/components/{inputs/phone-input.d.ts → ui/input/phone.d.ts} +1 -1
- package/dist/components/{inputs/phone-input.js → ui/input/phone.js} +2 -2
- package/dist/components/ui/input/quantity.cjs +1 -0
- package/dist/components/{inputs/quantity-input.js → ui/input/quantity.js} +6 -6
- package/dist/components/ui/input/search.cjs +1 -0
- package/dist/components/{inputs/search-input.d.ts → ui/input/search.d.ts} +1 -1
- package/dist/components/{inputs/search-input.js → ui/input/search.js} +2 -2
- package/dist/components/{inputs/input-value.js → ui/input/value.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +124 -138
- package/dist/public-component-surface.cjs +1 -1
- package/dist/public-component-surface.js +0 -5
- package/dist/showcase/fallback.cjs +3 -3
- package/dist/showcase/fallback.js +119 -118
- package/dist/showcase/premium/combobox/mock.cjs +4 -3
- package/dist/showcase/premium/combobox/mock.js +2 -2
- package/dist/showcase/premium/combobox/showcase.cjs +1 -1
- package/dist/showcase/premium/combobox/showcase.js +2 -2
- package/dist/showcase/premium/date-input/mock.cjs +4 -3
- package/dist/showcase/premium/date-input/mock.js +2 -2
- package/dist/showcase/premium/date-input/showcase.cjs +1 -1
- package/dist/showcase/premium/date-input/showcase.js +2 -1
- package/dist/showcase/premium/date-range-input/mock.cjs +4 -3
- package/dist/showcase/premium/date-range-input/mock.js +2 -2
- package/dist/showcase/premium/date-range-input/showcase.cjs +1 -1
- package/dist/showcase/premium/date-range-input/showcase.js +2 -1
- package/dist/showcase/premium/masked-input/mock.cjs +4 -3
- package/dist/showcase/premium/masked-input/mock.js +2 -2
- package/dist/showcase/premium/masked-input/showcase.cjs +1 -1
- package/dist/showcase/premium/masked-input/showcase.js +2 -1
- package/dist/showcase/premium/money-input/mock.cjs +4 -3
- package/dist/showcase/premium/money-input/mock.js +2 -2
- package/dist/showcase/premium/money-input/showcase.cjs +1 -1
- package/dist/showcase/premium/money-input/showcase.js +2 -1
- package/dist/showcase/premium/number-input/mock.cjs +5 -7
- package/dist/showcase/premium/number-input/mock.js +2 -2
- package/dist/showcase/premium/number-input/showcase.cjs +1 -1
- package/dist/showcase/premium/number-input/showcase.js +2 -1
- package/dist/showcase/premium/password-input/mock.cjs +3 -2
- package/dist/showcase/premium/password-input/mock.js +1 -1
- package/dist/showcase/premium/password-input/showcase.cjs +1 -1
- package/dist/showcase/premium/password-input/showcase.js +2 -1
- package/dist/showcase/premium/phone-input/mock.cjs +5 -4
- package/dist/showcase/premium/phone-input/mock.js +2 -2
- package/dist/showcase/premium/phone-input/showcase.cjs +1 -1
- package/dist/showcase/premium/phone-input/showcase.js +2 -1
- package/dist/showcase/premium/quantity-input/mock.cjs +4 -3
- package/dist/showcase/premium/quantity-input/mock.js +2 -2
- package/dist/showcase/premium/quantity-input/showcase.cjs +1 -1
- package/dist/showcase/premium/quantity-input/showcase.js +2 -1
- package/dist/showcase/premium/search-input/mock.cjs +3 -2
- package/dist/showcase/premium/search-input/mock.js +1 -1
- package/dist/showcase/premium/search-input/showcase.cjs +1 -1
- package/dist/showcase/premium/search-input/showcase.js +2 -1
- package/dist/showcase/premium/simple-select/mock.cjs +3 -3
- package/dist/showcase/premium/simple-select/mock.js +2 -2
- package/dist/showcase/premium/simple-select/showcase.cjs +1 -1
- package/dist/showcase/premium/simple-select/showcase.js +1 -1
- package/dist/showcase/registry-specific.cjs +1 -1
- package/dist/showcase/registry-specific.js +92 -92
- package/dist/showcase/render-registry-preview.cjs +1 -1
- package/dist/showcase/render-registry-preview.js +214 -215
- package/dist/showcase/site-data.cjs +1 -1
- package/dist/showcase/site-data.js +1 -24
- package/dist/showcase/tembro-registry.json.cjs +1 -1
- package/dist/showcase/tembro-registry.json.js +20 -16
- package/package.json +1 -1
- package/packages/cli/dist/index.cjs +43 -43
- package/packages/cli/vendor/src/components/form/form-date-range-input.tsx +5 -5
- package/packages/cli/vendor/src/components/form/form-input.tsx +7 -7
- package/packages/cli/vendor/src/components/inputs/index.ts +0 -14
- package/packages/cli/vendor/src/components/inputs/public.ts +0 -19
- package/packages/cli/vendor/src/components/{inputs/clearable-input.tsx → ui/input/clearable.tsx} +2 -2
- package/packages/cli/vendor/src/components/{inputs/date-range-input.tsx → ui/input/date-range.tsx} +1 -1
- package/packages/cli/vendor/src/components/{inputs/date-input.tsx → ui/input/date.tsx} +2 -2
- package/packages/cli/vendor/src/components/ui/input/index.tsx +11 -11
- package/packages/cli/vendor/src/components/{inputs/masked-input.tsx → ui/input/masked.tsx} +2 -2
- package/packages/cli/vendor/src/components/{inputs/money-input.tsx → ui/input/money.tsx} +3 -3
- package/packages/cli/vendor/src/components/{inputs/number-input.tsx → ui/input/number.tsx} +3 -3
- package/packages/cli/vendor/src/components/{inputs/password-input.tsx → ui/input/password.tsx} +1 -1
- package/packages/cli/vendor/src/components/{inputs/phone-input.tsx → ui/input/phone.tsx} +1 -1
- package/packages/cli/vendor/src/components/{inputs/quantity-input.tsx → ui/input/quantity.tsx} +3 -3
- package/packages/cli/vendor/src/components/{inputs/search-input.tsx → ui/input/search.tsx} +1 -1
- package/packages/cli/vendor/src/public-component-surface.ts +0 -1
- package/packages/cli/vendor/src/showcase/fallback.tsx +4 -6
- package/packages/cli/vendor/src/showcase/premium/combobox/mock.ts +4 -3
- package/packages/cli/vendor/src/showcase/premium/combobox/showcase.tsx +3 -3
- package/packages/cli/vendor/src/showcase/premium/date-input/mock.ts +4 -3
- package/packages/cli/vendor/src/showcase/premium/date-input/showcase.tsx +3 -2
- package/packages/cli/vendor/src/showcase/premium/date-range-input/mock.ts +4 -3
- package/packages/cli/vendor/src/showcase/premium/date-range-input/showcase.tsx +3 -2
- package/packages/cli/vendor/src/showcase/premium/masked-input/mock.ts +4 -3
- package/packages/cli/vendor/src/showcase/premium/masked-input/showcase.tsx +3 -2
- package/packages/cli/vendor/src/showcase/premium/money-input/mock.ts +4 -3
- package/packages/cli/vendor/src/showcase/premium/money-input/showcase.tsx +3 -2
- package/packages/cli/vendor/src/showcase/premium/number-input/mock.ts +5 -7
- package/packages/cli/vendor/src/showcase/premium/number-input/showcase.tsx +2 -2
- package/packages/cli/vendor/src/showcase/premium/password-input/mock.ts +3 -2
- package/packages/cli/vendor/src/showcase/premium/password-input/showcase.tsx +3 -2
- package/packages/cli/vendor/src/showcase/premium/phone-input/mock.ts +5 -4
- package/packages/cli/vendor/src/showcase/premium/phone-input/showcase.tsx +4 -3
- package/packages/cli/vendor/src/showcase/premium/quantity-input/mock.ts +4 -3
- package/packages/cli/vendor/src/showcase/premium/quantity-input/showcase.tsx +3 -2
- package/packages/cli/vendor/src/showcase/premium/search-input/mock.ts +3 -2
- package/packages/cli/vendor/src/showcase/premium/search-input/showcase.tsx +3 -2
- package/packages/cli/vendor/src/showcase/premium/simple-select/mock.ts +3 -3
- package/packages/cli/vendor/src/showcase/premium/simple-select/showcase.tsx +3 -3
- package/packages/cli/vendor/src/showcase/registry-specific.tsx +1 -2
- package/packages/cli/vendor/src/showcase/render-registry-preview.tsx +2 -4
- package/packages/cli/vendor/src/showcase/site-data.tsx +26 -0
- package/packages/cli/vendor/src/showcase/tembro-registry.json +18 -12
- package/registry.json +18 -12
- package/dist/components/inputs/clearable-input.cjs +0 -1
- package/dist/components/inputs/color-input.cjs +0 -1
- package/dist/components/inputs/color-input.d.ts +0 -11
- package/dist/components/inputs/color-input.js +0 -42
- package/dist/components/inputs/combobox.cjs +0 -1
- package/dist/components/inputs/combobox.d.ts +0 -29
- package/dist/components/inputs/combobox.js +0 -113
- package/dist/components/inputs/date-input.cjs +0 -1
- package/dist/components/inputs/input-chrome.cjs +0 -1
- package/dist/components/inputs/input-decorator.cjs +0 -1
- package/dist/components/inputs/masked-input.cjs +0 -1
- package/dist/components/inputs/money-input.cjs +0 -1
- package/dist/components/inputs/number-input.cjs +0 -1
- package/dist/components/inputs/password-input.cjs +0 -1
- package/dist/components/inputs/phone-input.cjs +0 -1
- package/dist/components/inputs/quantity-input.cjs +0 -1
- package/dist/components/inputs/quantity-stepper.cjs +0 -1
- package/dist/components/inputs/quantity-stepper.d.ts +0 -12
- package/dist/components/inputs/quantity-stepper.js +0 -52
- package/dist/components/inputs/search-input.cjs +0 -1
- package/dist/components/inputs/simple-select.cjs +0 -1
- package/dist/components/inputs/simple-select.d.ts +0 -13
- package/dist/components/inputs/simple-select.js +0 -8
- package/packages/cli/vendor/src/components/inputs/color-input.tsx +0 -49
- package/packages/cli/vendor/src/components/inputs/combobox.tsx +0 -180
- package/packages/cli/vendor/src/components/inputs/quantity-stepper.tsx +0 -51
- package/packages/cli/vendor/src/components/inputs/simple-select.tsx +0 -23
- /package/dist/components/{inputs/input-chrome.d.ts → ui/input/chrome.d.ts} +0 -0
- /package/dist/components/{inputs/input-decorator.d.ts → ui/input/decorator.d.ts} +0 -0
- /package/dist/components/{inputs/money-input.d.ts → ui/input/money.d.ts} +0 -0
- /package/dist/components/{inputs → ui/input}/numeric-value.cjs +0 -0
- /package/dist/components/{inputs → ui/input}/numeric-value.d.ts +0 -0
- /package/dist/components/{inputs/quantity-input.d.ts → ui/input/quantity.d.ts} +0 -0
- /package/dist/components/{inputs/input-value.cjs → ui/input/value.cjs} +0 -0
- /package/dist/components/{inputs/input-value.d.ts → ui/input/value.d.ts} +0 -0
- /package/packages/cli/vendor/src/components/{inputs/input-chrome.tsx → ui/input/chrome.tsx} +0 -0
- /package/packages/cli/vendor/src/components/{inputs/input-decorator.tsx → ui/input/decorator.tsx} +0 -0
- /package/packages/cli/vendor/src/components/{inputs → ui/input}/numeric-value.ts +0 -0
- /package/packages/cli/vendor/src/components/{inputs/input-value.ts → ui/input/value.ts} +0 -0
|
@@ -2,23 +2,24 @@ import type { ComponentDemoMock } from "../types"
|
|
|
2
2
|
|
|
3
3
|
export const phoneInputMock: ComponentDemoMock = {
|
|
4
4
|
code: `import { useState } from "react"
|
|
5
|
-
import {
|
|
5
|
+
import { Input } from "tembro"
|
|
6
6
|
|
|
7
7
|
export function Example() {
|
|
8
8
|
const [value, setValue] = useState("+998 90 123 45 67")
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
|
-
<
|
|
11
|
+
<Input
|
|
12
|
+
kind="phone"
|
|
12
13
|
value={value}
|
|
13
14
|
onValueChange={setValue}
|
|
14
|
-
|
|
15
|
+
countryCode="+998"
|
|
15
16
|
placeholder="+998 90 123 45 67"
|
|
16
17
|
/>
|
|
17
18
|
)
|
|
18
19
|
}
|
|
19
20
|
`,
|
|
20
21
|
htmlCode: '<label for="phone">Phone</label><input id="phone" type="tel" inputmode="tel" placeholder="+998 90 123 45 67" />',
|
|
21
|
-
cliCommand: "npx tembro add
|
|
22
|
+
cliCommand: "npx tembro add input",
|
|
22
23
|
highlights: ["Phone formatting assumptions", "Locale/defaultCountry behavior", "Controlled value contract", "Raw vs displayed phone forms"],
|
|
23
24
|
relatedBlockSlugs: ["users-table", "settings-form", "pricing-section"],
|
|
24
25
|
scenarios: [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState } from "react"
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Input } from "@/index"
|
|
4
4
|
|
|
5
5
|
import type { ComponentDemoProps } from "../types"
|
|
6
6
|
|
|
@@ -9,9 +9,10 @@ export function PhoneInputShowcase({ mode }: ComponentDemoProps) {
|
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
11
|
<div className="space-y-4">
|
|
12
|
-
<
|
|
12
|
+
<Input
|
|
13
|
+
kind="phone"
|
|
13
14
|
value={value}
|
|
14
|
-
onValueChange={(maskedValue) => setValue(maskedValue)}
|
|
15
|
+
onValueChange={(maskedValue: string) => setValue(maskedValue)}
|
|
15
16
|
countryCode="+998"
|
|
16
17
|
placeholder="+998 90 123 45 67"
|
|
17
18
|
/>
|
|
@@ -2,14 +2,15 @@ import type { ComponentDemoMock } from "../types"
|
|
|
2
2
|
|
|
3
3
|
export const quantityInputMock: ComponentDemoMock = {
|
|
4
4
|
code: `import { useState } from "react"
|
|
5
|
-
import {
|
|
5
|
+
import { Input } from "tembro"
|
|
6
6
|
|
|
7
7
|
export function Example() {
|
|
8
8
|
const [quantity, setQuantity] = useState<number | null>(3)
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
11
|
<div className="space-y-3">
|
|
12
|
-
<
|
|
12
|
+
<Input
|
|
13
|
+
kind="quantity"
|
|
13
14
|
value={quantity}
|
|
14
15
|
onValueChange={(nextValue: number | null) => setQuantity(nextValue)}
|
|
15
16
|
min={0}
|
|
@@ -30,7 +31,7 @@ export function Example() {
|
|
|
30
31
|
)
|
|
31
32
|
}`,
|
|
32
33
|
htmlCode: `<label for="qty">Quantity</label><input id="qty" type="text" inputmode="numeric" />`,
|
|
33
|
-
cliCommand: "npx tembro add
|
|
34
|
+
cliCommand: "npx tembro add input",
|
|
34
35
|
highlights: ["Stepper controls", "min/max boundaries", "controlled usage", "compact row compatibility"],
|
|
35
36
|
relatedBlockSlugs: ["crm-dashboard", "users-table", "settings-form"],
|
|
36
37
|
scenarios: [
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { useState } from "react"
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Input } from "@/index"
|
|
4
4
|
|
|
5
5
|
export function QuantityInputShowcase() {
|
|
6
6
|
const [value, setValue] = useState<number | null>(2)
|
|
7
7
|
|
|
8
8
|
return (
|
|
9
9
|
<div className="space-y-3">
|
|
10
|
-
<
|
|
10
|
+
<Input
|
|
11
|
+
kind="quantity"
|
|
11
12
|
value={value}
|
|
12
13
|
onValueChange={setValue}
|
|
13
14
|
min={0}
|
|
@@ -2,13 +2,14 @@ import type { ComponentDemoMock } from "../types"
|
|
|
2
2
|
|
|
3
3
|
export const searchInputMock: ComponentDemoMock = {
|
|
4
4
|
code: `import * as React from "react"
|
|
5
|
-
import {
|
|
5
|
+
import { Input, Kbd } from "tembro"
|
|
6
6
|
|
|
7
7
|
export function Example() {
|
|
8
8
|
const [value, setValue] = React.useState("")
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
|
-
<
|
|
11
|
+
<Input
|
|
12
|
+
kind="search"
|
|
12
13
|
value={value}
|
|
13
14
|
onValueChange={setValue}
|
|
14
15
|
placeholder="Search customers, invoices, or routes..."
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
|
|
3
|
-
import { Badge,
|
|
3
|
+
import { Badge, Input, Kbd } from "@/index"
|
|
4
4
|
|
|
5
5
|
import type { ComponentDemoProps } from "../types"
|
|
6
6
|
|
|
@@ -45,7 +45,8 @@ export function SearchInputShowcase({ mode }: ComponentDemoProps) {
|
|
|
45
45
|
</section>
|
|
46
46
|
|
|
47
47
|
<section className={panelClass}>
|
|
48
|
-
<
|
|
48
|
+
<Input
|
|
49
|
+
kind="search"
|
|
49
50
|
value={value}
|
|
50
51
|
onValueChange={setValue}
|
|
51
52
|
onDebouncedValueChange={setDebouncedValue}
|
|
@@ -2,7 +2,7 @@ import type { ComponentDemoMock } from "../types"
|
|
|
2
2
|
|
|
3
3
|
export const simpleSelectMock: ComponentDemoMock = {
|
|
4
4
|
code: `import { useState } from "react"
|
|
5
|
-
import { Button,
|
|
5
|
+
import { Button, Select } from "tembro"
|
|
6
6
|
|
|
7
7
|
const selectOptions = [
|
|
8
8
|
{ value: "public", label: "Public", disabled: false },
|
|
@@ -16,7 +16,7 @@ export function Example() {
|
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
18
|
<div className="space-y-3">
|
|
19
|
-
<
|
|
19
|
+
<Select
|
|
20
20
|
options={selectOptions}
|
|
21
21
|
value={value}
|
|
22
22
|
onValueChange={(nextValue) => setValue(nextValue ?? "private")}
|
|
@@ -31,7 +31,7 @@ export function Example() {
|
|
|
31
31
|
)
|
|
32
32
|
}`,
|
|
33
33
|
htmlCode: `<button data-slot="simple-select-trigger">Open options</button>`,
|
|
34
|
-
cliCommand: "npx tembro add
|
|
34
|
+
cliCommand: "npx tembro add select",
|
|
35
35
|
highlights: ["Controlled usage", "Static options", "Clear default value", "Disabled option handling"],
|
|
36
36
|
relatedBlockSlugs: ["settings-form", "users-table", "crm-dashboard"],
|
|
37
37
|
scenarios: [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState } from "react"
|
|
2
2
|
|
|
3
|
-
import { Badge, Button,
|
|
3
|
+
import { Badge, Button, Select } from "@/index"
|
|
4
4
|
import { routeSimpleSelectOptions } from "@/showcase/component-route-data"
|
|
5
5
|
|
|
6
6
|
import type { ComponentDemoProps } from "../types"
|
|
@@ -24,7 +24,7 @@ export function SimpleSelectShowcase({ mode }: ComponentDemoProps) {
|
|
|
24
24
|
<Badge variant="outline">Clearable</Badge>
|
|
25
25
|
</div>
|
|
26
26
|
</div>
|
|
27
|
-
<
|
|
27
|
+
<Select
|
|
28
28
|
value={value}
|
|
29
29
|
onValueChange={(nextValue) => setValue(nextValue)}
|
|
30
30
|
options={options}
|
|
@@ -47,7 +47,7 @@ export function SimpleSelectShowcase({ mode }: ComponentDemoProps) {
|
|
|
47
47
|
<p className="mt-2 aui-text-muted">Choose this for local option lists before moving to AsyncSelect.</p>
|
|
48
48
|
</div>
|
|
49
49
|
</div>
|
|
50
|
-
<
|
|
50
|
+
<Select key={uncontrolledKey} defaultValue="public" options={options} showSelectedDescription />
|
|
51
51
|
<div className="flex flex-wrap gap-2">
|
|
52
52
|
<Button variant="outline" size="sm" onClick={() => setValue(undefined)}>
|
|
53
53
|
Clear controlled
|
|
@@ -33,7 +33,6 @@ import {
|
|
|
33
33
|
PageState,
|
|
34
34
|
PageTabs,
|
|
35
35
|
Pagination,
|
|
36
|
-
PasswordInput,
|
|
37
36
|
Progress,
|
|
38
37
|
ProgressCircle,
|
|
39
38
|
QuickActionGrid,
|
|
@@ -253,7 +252,7 @@ function InputPreview({
|
|
|
253
252
|
}
|
|
254
253
|
|
|
255
254
|
if (slug === "password-input") {
|
|
256
|
-
return <
|
|
255
|
+
return <Input kind="password" value="secret-token" onValueChange={onValueChange} placeholder="Password" />
|
|
257
256
|
}
|
|
258
257
|
|
|
259
258
|
if (slug === "slider") {
|
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
Button,
|
|
20
20
|
ButtonGroup,
|
|
21
21
|
Calendar,
|
|
22
|
-
ColorInput,
|
|
23
22
|
CommandPalette,
|
|
24
23
|
DescriptionList,
|
|
25
24
|
DialogActionButton,
|
|
@@ -35,7 +34,6 @@ import {
|
|
|
35
34
|
PageState,
|
|
36
35
|
PageTabs,
|
|
37
36
|
Pagination,
|
|
38
|
-
PasswordInput,
|
|
39
37
|
Progress,
|
|
40
38
|
ProgressCircle,
|
|
41
39
|
QuickActionGrid,
|
|
@@ -109,7 +107,7 @@ function InputPreview({
|
|
|
109
107
|
}
|
|
110
108
|
|
|
111
109
|
if (slug === "password-input") {
|
|
112
|
-
return <
|
|
110
|
+
return <Input kind="password" value="secret-token" onValueChange={onValueChange} placeholder="Password" />
|
|
113
111
|
}
|
|
114
112
|
|
|
115
113
|
if (slug === "clearable-input") {
|
|
@@ -133,7 +131,7 @@ function InputPreview({
|
|
|
133
131
|
}
|
|
134
132
|
|
|
135
133
|
if (slug === "color-input") {
|
|
136
|
-
return <
|
|
134
|
+
return <Input type="color" defaultValue="#22c55e" aria-label="Accent color" />
|
|
137
135
|
}
|
|
138
136
|
|
|
139
137
|
if (slug === "tag-input") {
|
|
@@ -1793,11 +1793,26 @@ const migrationAliasTargets = new Set(Object.values(kitMigrationAliases))
|
|
|
1793
1793
|
|
|
1794
1794
|
const internalComponentCatalogSlugs = new Set([
|
|
1795
1795
|
"app-header",
|
|
1796
|
+
"app-sidebar",
|
|
1796
1797
|
"app-shell",
|
|
1797
1798
|
"async-multi-select",
|
|
1798
1799
|
"clearable-input",
|
|
1800
|
+
"combobox",
|
|
1799
1801
|
"copy-field",
|
|
1802
|
+
"data-table-actions-column",
|
|
1803
|
+
"data-table-bulk-actions",
|
|
1804
|
+
"data-table-column-visibility-menu",
|
|
1805
|
+
"data-table-pagination",
|
|
1806
|
+
"data-table-row-actions",
|
|
1807
|
+
"data-table-saved-filters",
|
|
1808
|
+
"data-table-select-column",
|
|
1809
|
+
"data-table-sortable-header",
|
|
1810
|
+
"data-table-toolbar",
|
|
1811
|
+
"data-table-view-presets",
|
|
1812
|
+
"date-input",
|
|
1813
|
+
"date-range-input",
|
|
1800
1814
|
"file-dropzone",
|
|
1815
|
+
"form",
|
|
1801
1816
|
"form-async-select",
|
|
1802
1817
|
"form-field",
|
|
1803
1818
|
"form-field-shell",
|
|
@@ -1806,14 +1821,25 @@ const internalComponentCatalogSlugs = new Set([
|
|
|
1806
1821
|
"form-switch",
|
|
1807
1822
|
"form-textarea",
|
|
1808
1823
|
"hover-card",
|
|
1824
|
+
"input-decorator",
|
|
1825
|
+
"input-value",
|
|
1826
|
+
"inputs",
|
|
1827
|
+
"masked-input",
|
|
1828
|
+
"money-input",
|
|
1829
|
+
"number-input",
|
|
1809
1830
|
"page-container",
|
|
1810
1831
|
"page-header",
|
|
1832
|
+
"password-input",
|
|
1833
|
+
"phone-input",
|
|
1811
1834
|
"quantity-input",
|
|
1835
|
+
"search-input",
|
|
1812
1836
|
"section-header",
|
|
1813
1837
|
"sidebar-nav",
|
|
1814
1838
|
"simple-select",
|
|
1815
1839
|
"stat-card",
|
|
1816
1840
|
"sticky-footer-bar",
|
|
1841
|
+
"table-export-menu",
|
|
1842
|
+
"table-import-button",
|
|
1817
1843
|
])
|
|
1818
1844
|
|
|
1819
1845
|
const hiddenKitGroups = new Set(["kits"])
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://tembro.dev/registry.schema.json",
|
|
3
3
|
"name": "tembro",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.9",
|
|
5
5
|
"description": "Reusable React + TypeScript UI kit registry",
|
|
6
6
|
"groups": {
|
|
7
7
|
"ui": [
|
|
@@ -46,16 +46,8 @@
|
|
|
46
46
|
],
|
|
47
47
|
"inputs": [
|
|
48
48
|
"async-select",
|
|
49
|
-
"combobox",
|
|
50
|
-
"masked-input",
|
|
51
|
-
"money-input",
|
|
52
|
-
"number-input",
|
|
53
49
|
"otp-input",
|
|
54
|
-
"password-input",
|
|
55
|
-
"phone-input",
|
|
56
|
-
"quantity-stepper",
|
|
57
50
|
"rating",
|
|
58
|
-
"search-input",
|
|
59
51
|
"slider",
|
|
60
52
|
"tag-input",
|
|
61
53
|
"inline-editable"
|
|
@@ -235,7 +227,6 @@
|
|
|
235
227
|
],
|
|
236
228
|
"system": [
|
|
237
229
|
"data-table",
|
|
238
|
-
"data-table-view-presets",
|
|
239
230
|
"sidebar"
|
|
240
231
|
]
|
|
241
232
|
},
|
|
@@ -265,7 +256,6 @@
|
|
|
265
256
|
"skeleton",
|
|
266
257
|
"spinner",
|
|
267
258
|
"command-bar",
|
|
268
|
-
"quantity-stepper",
|
|
269
259
|
"inline-editable",
|
|
270
260
|
"avatar",
|
|
271
261
|
"code-block",
|
|
@@ -324,6 +314,22 @@
|
|
|
324
314
|
"section-header": "section",
|
|
325
315
|
"sidebar-nav": "sidebar",
|
|
326
316
|
"stat-card": "metric-grid",
|
|
327
|
-
"sticky-footer-bar": "sidebar"
|
|
317
|
+
"sticky-footer-bar": "sidebar",
|
|
318
|
+
"input-decorator": "input",
|
|
319
|
+
"input-value": "input",
|
|
320
|
+
"inputs": "input",
|
|
321
|
+
"form": "input",
|
|
322
|
+
"data-table-actions-column": "data-table",
|
|
323
|
+
"data-table-bulk-actions": "data-table",
|
|
324
|
+
"data-table-column-visibility-menu": "data-table",
|
|
325
|
+
"data-table-pagination": "data-table",
|
|
326
|
+
"data-table-row-actions": "data-table",
|
|
327
|
+
"data-table-saved-filters": "data-table",
|
|
328
|
+
"data-table-select-column": "data-table",
|
|
329
|
+
"data-table-sortable-header": "data-table",
|
|
330
|
+
"data-table-toolbar": "data-table",
|
|
331
|
+
"data-table-view-presets": "data-table",
|
|
332
|
+
"table-export-menu": "data-table",
|
|
333
|
+
"table-import-button": "data-table"
|
|
328
334
|
}
|
|
329
335
|
}
|
package/registry.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://tembro.dev/registry.schema.json",
|
|
3
3
|
"name": "tembro",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.9",
|
|
5
5
|
"description": "Reusable React + TypeScript UI kit registry",
|
|
6
6
|
"groups": {
|
|
7
7
|
"ui": [
|
|
@@ -46,16 +46,8 @@
|
|
|
46
46
|
],
|
|
47
47
|
"inputs": [
|
|
48
48
|
"async-select",
|
|
49
|
-
"combobox",
|
|
50
|
-
"masked-input",
|
|
51
|
-
"money-input",
|
|
52
|
-
"number-input",
|
|
53
49
|
"otp-input",
|
|
54
|
-
"password-input",
|
|
55
|
-
"phone-input",
|
|
56
|
-
"quantity-stepper",
|
|
57
50
|
"rating",
|
|
58
|
-
"search-input",
|
|
59
51
|
"slider",
|
|
60
52
|
"tag-input",
|
|
61
53
|
"inline-editable"
|
|
@@ -235,7 +227,6 @@
|
|
|
235
227
|
],
|
|
236
228
|
"system": [
|
|
237
229
|
"data-table",
|
|
238
|
-
"data-table-view-presets",
|
|
239
230
|
"sidebar"
|
|
240
231
|
]
|
|
241
232
|
},
|
|
@@ -265,7 +256,6 @@
|
|
|
265
256
|
"skeleton",
|
|
266
257
|
"spinner",
|
|
267
258
|
"command-bar",
|
|
268
|
-
"quantity-stepper",
|
|
269
259
|
"inline-editable",
|
|
270
260
|
"avatar",
|
|
271
261
|
"code-block",
|
|
@@ -324,6 +314,22 @@
|
|
|
324
314
|
"section-header": "section",
|
|
325
315
|
"sidebar-nav": "sidebar",
|
|
326
316
|
"stat-card": "metric-grid",
|
|
327
|
-
"sticky-footer-bar": "sidebar"
|
|
317
|
+
"sticky-footer-bar": "sidebar",
|
|
318
|
+
"input-decorator": "input",
|
|
319
|
+
"input-value": "input",
|
|
320
|
+
"inputs": "input",
|
|
321
|
+
"form": "input",
|
|
322
|
+
"data-table-actions-column": "data-table",
|
|
323
|
+
"data-table-bulk-actions": "data-table",
|
|
324
|
+
"data-table-column-visibility-menu": "data-table",
|
|
325
|
+
"data-table-pagination": "data-table",
|
|
326
|
+
"data-table-row-actions": "data-table",
|
|
327
|
+
"data-table-saved-filters": "data-table",
|
|
328
|
+
"data-table-select-column": "data-table",
|
|
329
|
+
"data-table-sortable-header": "data-table",
|
|
330
|
+
"data-table-toolbar": "data-table",
|
|
331
|
+
"data-table-view-presets": "data-table",
|
|
332
|
+
"table-export-menu": "data-table",
|
|
333
|
+
"table-import-button": "data-table"
|
|
328
334
|
}
|
|
329
335
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("./input-decorator.cjs"),r=require("./input-value.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("lucide-react"),o=require("react/jsx-runtime");var s=i.forwardRef(({value:e,onChange:s,onValueChange:c,onClear:l,clearable:u=!0,clearLabel:d=`Clear`,clearOnEscape:f=!0,focusAfterClear:p=!0,replaceTrailingWhenClear:m=!0,leadingIcon:h,trailing:g,trailingAction:_,disabled:v,onKeyDown:y,...b},x)=>{let S=i.useRef(null),C=r.getInputValue(e),w=u&&C.length>0&&!v&&!b.readOnly,T=r.createInputChangeHandler({onChange:s,onValueChange:c});i.useImperativeHandle(x,()=>S.current);let E=()=>{w&&(c?.(``),l?.(),p&&S.current?.focus())},D=e=>{t.stopInteractivePropagation(e),E()},O=e=>{t.stopInteractivePropagation(e)};return(0,o.jsx)(n.InputDecorator,{"data-slot":`clearable-input`,ref:S,value:C,disabled:v,onChange:T,onKeyDown:e=>{y?.(e),!e.defaultPrevented&&f&&e.key===`Escape`&&w&&(e.preventDefault(),E())},leading:h,trailing:w&&m?null:g,trailingAction:(0,o.jsxs)(o.Fragment,{children:[_,w&&(0,o.jsx)(`button`,{type:`button`,"data-slot":`clearable-input-clear`,"aria-label":d,className:`inline-flex size-7 items-center justify-center rounded-[var(--radius-sm)] border border-transparent bg-transparent text-muted-foreground/74 transition hover:border-border/60 hover:bg-muted/58 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/30`,onClick:D,onMouseDown:O,onDoubleClick:O,children:(0,o.jsx)(a.XIcon,{className:`size-4`})})]}),...b})});s.displayName=`ClearableInput`,exports.ClearableInput=s;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/input/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");function a({value:e,defaultValue:a=`#000000`,onValueChange:o,label:s,description:c,swatchClassName:l,className:u,disabled:d,...f}){let[p,m]=r.useState(a),h=e??p,g=t=>{e===void 0&&m(t),o?.(t)};return(0,i.jsxs)(`div`,{"data-slot":`color-input`,className:t.cn(`grid gap-2`,u),children:[(s||c)&&(0,i.jsxs)(`div`,{className:`grid gap-0.5`,children:[s&&(0,i.jsx)(`label`,{className:`text-sm font-medium text-foreground`,children:s}),c&&(0,i.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:c})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(`input`,{type:`color`,value:h,disabled:d,className:t.cn(`size-9 cursor-pointer rounded-md border bg-background p-1 disabled:cursor-not-allowed disabled:opacity-50`,l),onChange:e=>g(e.currentTarget.value),...f}),(0,i.jsx)(n.Input,{value:h,disabled:d,onChange:e=>g(e.currentTarget.value),className:`font-mono`})]})]})}exports.ColorInput=a;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export type ColorInputProps = Omit<React.ComponentProps<"input">, "type" | "value" | "defaultValue" | "onChange"> & {
|
|
3
|
-
value?: string;
|
|
4
|
-
defaultValue?: string;
|
|
5
|
-
onValueChange?: (value: string) => void;
|
|
6
|
-
label?: React.ReactNode;
|
|
7
|
-
description?: React.ReactNode;
|
|
8
|
-
swatchClassName?: string;
|
|
9
|
-
};
|
|
10
|
-
declare function ColorInput({ value, defaultValue, onValueChange, label, description, swatchClassName, className, disabled, ...props }: ColorInputProps): React.JSX.Element;
|
|
11
|
-
export { ColorInput };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { cn as e } from "../../lib/utils.js";
|
|
3
|
-
import { Input as t } from "../ui/input/index.js";
|
|
4
|
-
import * as n from "react";
|
|
5
|
-
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
-
//#region src/components/inputs/color-input.tsx
|
|
7
|
-
function a({ value: a, defaultValue: o = "#000000", onValueChange: s, label: c, description: l, swatchClassName: u, className: d, disabled: f, ...p }) {
|
|
8
|
-
let [m, h] = n.useState(o), g = a ?? m, _ = (e) => {
|
|
9
|
-
a === void 0 && h(e), s?.(e);
|
|
10
|
-
};
|
|
11
|
-
return /* @__PURE__ */ i("div", {
|
|
12
|
-
"data-slot": "color-input",
|
|
13
|
-
className: e("grid gap-2", d),
|
|
14
|
-
children: [(c || l) && /* @__PURE__ */ i("div", {
|
|
15
|
-
className: "grid gap-0.5",
|
|
16
|
-
children: [c && /* @__PURE__ */ r("label", {
|
|
17
|
-
className: "text-sm font-medium text-foreground",
|
|
18
|
-
children: c
|
|
19
|
-
}), l && /* @__PURE__ */ r("div", {
|
|
20
|
-
className: "text-xs text-muted-foreground",
|
|
21
|
-
children: l
|
|
22
|
-
})]
|
|
23
|
-
}), /* @__PURE__ */ i("div", {
|
|
24
|
-
className: "flex items-center gap-2",
|
|
25
|
-
children: [/* @__PURE__ */ r("input", {
|
|
26
|
-
type: "color",
|
|
27
|
-
value: g,
|
|
28
|
-
disabled: f,
|
|
29
|
-
className: e("size-9 cursor-pointer rounded-md border bg-background p-1 disabled:cursor-not-allowed disabled:opacity-50", u),
|
|
30
|
-
onChange: (e) => _(e.currentTarget.value),
|
|
31
|
-
...p
|
|
32
|
-
}), /* @__PURE__ */ r(t, {
|
|
33
|
-
value: g,
|
|
34
|
-
disabled: f,
|
|
35
|
-
onChange: (e) => _(e.currentTarget.value),
|
|
36
|
-
className: "font-mono"
|
|
37
|
-
})]
|
|
38
|
-
})]
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
|
-
export { a as ColorInput };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs"),r=require("../ui/input/index.cjs"),i=require("../ui/popover/index.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("lucide-react"),s=require("react/jsx-runtime");function c({value:e,options:c,onValueChange:l,placeholder:u=`Select option`,searchPlaceholder:d=`Search...`,emptyLabel:f=`No option found`,disabled:p=!1,invalid:m,clearable:h=!1,allowDeselect:g=!1,showSelectedDescription:_=!0,onSearchChange:v,triggerClassName:y,contentClassName:b,optionClassName:x,searchClassName:S,className:C,...w}){let[T,E]=a.useState(!1),[D,O]=a.useState(``),k=c.find(t=>t.value===e),A=D.trim().toLowerCase(),j=c.filter(e=>e.hidden?!1:A?String(e.searchValue??e.label).toLowerCase().includes(A):!0);return(0,s.jsx)(`div`,{"data-slot":`combobox`,className:t.cn(`grid w-full gap-2`,C),...w,children:(0,s.jsxs)(i.Popover,{open:T,onOpenChange:e=>{E(e),e||(O(``),v?.(``))},children:[(0,s.jsxs)(i.PopoverTrigger,{render:(0,s.jsx)(n.Button,{type:`button`,variant:`outline`,disabled:p,"aria-expanded":T,"aria-invalid":m||void 0,className:t.cn(`min-h-11 w-full justify-between rounded-[var(--aui-control-radius,var(--radius-md))] px-3.5 text-left`,y)}),children:[(0,s.jsx)(`span`,{className:t.cn(`min-w-0 flex-1`,!k&&`text-muted-foreground`),children:k?(0,s.jsxs)(`span`,{className:`flex min-w-0 flex-col items-start`,children:[(0,s.jsx)(`span`,{className:`truncate font-medium`,children:k.label}),_&&k.description?(0,s.jsx)(`span`,{className:`truncate text-[11px] text-muted-foreground`,children:k.description}):null]}):(0,s.jsx)(`span`,{className:`truncate font-normal`,children:u})}),h&&k&&!p?(0,s.jsx)(`span`,{role:`button`,tabIndex:0,"aria-label":`Clear value`,className:`inline-flex size-6 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-muted/55 hover:text-foreground`,onClick:e=>{e.preventDefault(),e.stopPropagation(),l?.(void 0,void 0)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),l?.(void 0,void 0))},children:`×`}):null,(0,s.jsx)(o.ChevronDownIcon,{className:`size-4 opacity-60`})]}),(0,s.jsxs)(i.PopoverContent,{align:`start`,"data-slot":`combobox-content`,className:t.cn(`w-(--anchor-width) min-w-72 rounded-[var(--aui-card-radius,var(--radius-lg))] border-[color:var(--aui-card-border,var(--border))] bg-popover p-3 shadow-[var(--aui-control-panel-shadow,0_18px_40px_rgba(15,23,42,0.14))]`,b),children:[(0,s.jsxs)(`div`,{className:`relative mb-2`,children:[(0,s.jsx)(o.SearchIcon,{className:`pointer-events-none absolute left-2 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`}),(0,s.jsx)(r.Input,{value:D,onChange:e=>{O(e.target.value),v?.(e.target.value)},placeholder:d,className:t.cn(`h-9 pl-8`,S)})]}),(0,s.jsx)(`div`,{className:`max-h-64 overflow-y-auto`,children:j.length?j.map(n=>{let r=n.value===e;return(0,s.jsxs)(`button`,{type:`button`,disabled:n.disabled,"data-selected":r||void 0,className:t.cn(`flex w-full items-start gap-2.5 rounded-[var(--radius-md)] border border-transparent px-3 py-2.5 text-left text-sm transition-colors hover:border-[color:color-mix(in_oklch,var(--primary),transparent_76%)] hover:bg-[color:color-mix(in_oklch,var(--primary),transparent_93%)] disabled:pointer-events-none disabled:opacity-50 data-[selected=true]:border-[color:color-mix(in_oklch,var(--primary),transparent_68%)] data-[selected=true]:bg-[color:color-mix(in_oklch,var(--primary),transparent_89%)]`,x),onClick:()=>{let e=g&&r?void 0:n.value;l?.(e,e?n:void 0),E(!1)},children:[(0,s.jsx)(`span`,{className:t.cn(`mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border border-border/70`,r&&`border-primary bg-primary text-primary-foreground`),children:r&&(0,s.jsx)(o.CheckIcon,{className:`size-3`})}),(0,s.jsxs)(`span`,{className:`min-w-0`,children:[(0,s.jsx)(`span`,{className:`block truncate font-medium`,children:n.label}),n.description&&(0,s.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:n.description})]})]},n.value)}):(0,s.jsx)(`div`,{className:`rounded-[var(--radius-md)] border border-[color:var(--aui-card-border,var(--border))] bg-[color:color-mix(in_oklch,var(--muted),transparent_55%)] px-3 py-6 text-center text-sm text-muted-foreground`,children:f})})]})]})})}exports.Combobox=c;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export type ComboboxOption<TValue extends string = string> = {
|
|
3
|
-
value: TValue;
|
|
4
|
-
label: React.ReactNode;
|
|
5
|
-
searchValue?: string;
|
|
6
|
-
description?: React.ReactNode;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
hidden?: boolean;
|
|
9
|
-
};
|
|
10
|
-
export type ComboboxProps<TValue extends string = string> = React.ComponentProps<"div"> & {
|
|
11
|
-
value?: TValue;
|
|
12
|
-
options: ComboboxOption<TValue>[];
|
|
13
|
-
onValueChange?: (value: TValue | undefined, option?: ComboboxOption<TValue>) => void;
|
|
14
|
-
placeholder?: React.ReactNode;
|
|
15
|
-
searchPlaceholder?: string;
|
|
16
|
-
emptyLabel?: React.ReactNode;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
invalid?: boolean;
|
|
19
|
-
clearable?: boolean;
|
|
20
|
-
allowDeselect?: boolean;
|
|
21
|
-
showSelectedDescription?: boolean;
|
|
22
|
-
onSearchChange?: (value: string) => void;
|
|
23
|
-
triggerClassName?: string;
|
|
24
|
-
contentClassName?: string;
|
|
25
|
-
optionClassName?: string;
|
|
26
|
-
searchClassName?: string;
|
|
27
|
-
};
|
|
28
|
-
declare function Combobox<TValue extends string = string>({ value, options, onValueChange, placeholder, searchPlaceholder, emptyLabel, disabled, invalid, clearable, allowDeselect, showSelectedDescription, onSearchChange, triggerClassName, contentClassName, optionClassName, searchClassName, className, ...props }: ComboboxProps<TValue>): React.JSX.Element;
|
|
29
|
-
export { Combobox };
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { cn as e } from "../../lib/utils.js";
|
|
3
|
-
import { Button as t } from "../ui/button/index.js";
|
|
4
|
-
import { Input as n } from "../ui/input/index.js";
|
|
5
|
-
import { Popover as r, PopoverContent as i, PopoverTrigger as a } from "../ui/popover/index.js";
|
|
6
|
-
import * as o from "react";
|
|
7
|
-
import { CheckIcon as s, ChevronDownIcon as c, SearchIcon as l } from "lucide-react";
|
|
8
|
-
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
9
|
-
//#region src/components/inputs/combobox.tsx
|
|
10
|
-
function f({ value: f, options: p, onValueChange: m, placeholder: h = "Select option", searchPlaceholder: g = "Search...", emptyLabel: _ = "No option found", disabled: v = !1, invalid: y, clearable: b = !1, allowDeselect: x = !1, showSelectedDescription: S = !0, onSearchChange: C, triggerClassName: w, contentClassName: T, optionClassName: E, searchClassName: D, className: O, ...k }) {
|
|
11
|
-
let [A, j] = o.useState(!1), [M, N] = o.useState(""), P = p.find((e) => e.value === f), F = M.trim().toLowerCase(), I = p.filter((e) => e.hidden ? !1 : F ? String(e.searchValue ?? e.label).toLowerCase().includes(F) : !0);
|
|
12
|
-
return /* @__PURE__ */ u("div", {
|
|
13
|
-
"data-slot": "combobox",
|
|
14
|
-
className: e("grid w-full gap-2", O),
|
|
15
|
-
...k,
|
|
16
|
-
children: /* @__PURE__ */ d(r, {
|
|
17
|
-
open: A,
|
|
18
|
-
onOpenChange: (e) => {
|
|
19
|
-
j(e), e || (N(""), C?.(""));
|
|
20
|
-
},
|
|
21
|
-
children: [/* @__PURE__ */ d(a, {
|
|
22
|
-
render: /* @__PURE__ */ u(t, {
|
|
23
|
-
type: "button",
|
|
24
|
-
variant: "outline",
|
|
25
|
-
disabled: v,
|
|
26
|
-
"aria-expanded": A,
|
|
27
|
-
"aria-invalid": y || void 0,
|
|
28
|
-
className: e("min-h-11 w-full justify-between rounded-[var(--aui-control-radius,var(--radius-md))] px-3.5 text-left", w)
|
|
29
|
-
}),
|
|
30
|
-
children: [
|
|
31
|
-
/* @__PURE__ */ u("span", {
|
|
32
|
-
className: e("min-w-0 flex-1", !P && "text-muted-foreground"),
|
|
33
|
-
children: P ? /* @__PURE__ */ d("span", {
|
|
34
|
-
className: "flex min-w-0 flex-col items-start",
|
|
35
|
-
children: [/* @__PURE__ */ u("span", {
|
|
36
|
-
className: "truncate font-medium",
|
|
37
|
-
children: P.label
|
|
38
|
-
}), S && P.description ? /* @__PURE__ */ u("span", {
|
|
39
|
-
className: "truncate text-[11px] text-muted-foreground",
|
|
40
|
-
children: P.description
|
|
41
|
-
}) : null]
|
|
42
|
-
}) : /* @__PURE__ */ u("span", {
|
|
43
|
-
className: "truncate font-normal",
|
|
44
|
-
children: h
|
|
45
|
-
})
|
|
46
|
-
}),
|
|
47
|
-
b && P && !v ? /* @__PURE__ */ u("span", {
|
|
48
|
-
role: "button",
|
|
49
|
-
tabIndex: 0,
|
|
50
|
-
"aria-label": "Clear value",
|
|
51
|
-
className: "inline-flex size-6 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-muted/55 hover:text-foreground",
|
|
52
|
-
onClick: (e) => {
|
|
53
|
-
e.preventDefault(), e.stopPropagation(), m?.(void 0, void 0);
|
|
54
|
-
},
|
|
55
|
-
onKeyDown: (e) => {
|
|
56
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), m?.(void 0, void 0));
|
|
57
|
-
},
|
|
58
|
-
children: "×"
|
|
59
|
-
}) : null,
|
|
60
|
-
/* @__PURE__ */ u(c, { className: "size-4 opacity-60" })
|
|
61
|
-
]
|
|
62
|
-
}), /* @__PURE__ */ d(i, {
|
|
63
|
-
align: "start",
|
|
64
|
-
"data-slot": "combobox-content",
|
|
65
|
-
className: e("w-(--anchor-width) min-w-72 rounded-[var(--aui-card-radius,var(--radius-lg))] border-[color:var(--aui-card-border,var(--border))] bg-popover p-3 shadow-[var(--aui-control-panel-shadow,0_18px_40px_rgba(15,23,42,0.14))]", T),
|
|
66
|
-
children: [/* @__PURE__ */ d("div", {
|
|
67
|
-
className: "relative mb-2",
|
|
68
|
-
children: [/* @__PURE__ */ u(l, { className: "pointer-events-none absolute left-2 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ u(n, {
|
|
69
|
-
value: M,
|
|
70
|
-
onChange: (e) => {
|
|
71
|
-
N(e.target.value), C?.(e.target.value);
|
|
72
|
-
},
|
|
73
|
-
placeholder: g,
|
|
74
|
-
className: e("h-9 pl-8", D)
|
|
75
|
-
})]
|
|
76
|
-
}), /* @__PURE__ */ u("div", {
|
|
77
|
-
className: "max-h-64 overflow-y-auto",
|
|
78
|
-
children: I.length ? I.map((t) => {
|
|
79
|
-
let n = t.value === f;
|
|
80
|
-
return /* @__PURE__ */ d("button", {
|
|
81
|
-
type: "button",
|
|
82
|
-
disabled: t.disabled,
|
|
83
|
-
"data-selected": n || void 0,
|
|
84
|
-
className: e("flex w-full items-start gap-2.5 rounded-[var(--radius-md)] border border-transparent px-3 py-2.5 text-left text-sm transition-colors hover:border-[color:color-mix(in_oklch,var(--primary),transparent_76%)] hover:bg-[color:color-mix(in_oklch,var(--primary),transparent_93%)] disabled:pointer-events-none disabled:opacity-50 data-[selected=true]:border-[color:color-mix(in_oklch,var(--primary),transparent_68%)] data-[selected=true]:bg-[color:color-mix(in_oklch,var(--primary),transparent_89%)]", E),
|
|
85
|
-
onClick: () => {
|
|
86
|
-
let e = x && n ? void 0 : t.value;
|
|
87
|
-
m?.(e, e ? t : void 0), j(!1);
|
|
88
|
-
},
|
|
89
|
-
children: [/* @__PURE__ */ u("span", {
|
|
90
|
-
className: e("mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border border-border/70", n && "border-primary bg-primary text-primary-foreground"),
|
|
91
|
-
children: n && /* @__PURE__ */ u(s, { className: "size-3" })
|
|
92
|
-
}), /* @__PURE__ */ d("span", {
|
|
93
|
-
className: "min-w-0",
|
|
94
|
-
children: [/* @__PURE__ */ u("span", {
|
|
95
|
-
className: "block truncate font-medium",
|
|
96
|
-
children: t.label
|
|
97
|
-
}), t.description && /* @__PURE__ */ u("span", {
|
|
98
|
-
className: "block text-xs text-muted-foreground",
|
|
99
|
-
children: t.description
|
|
100
|
-
})]
|
|
101
|
-
})]
|
|
102
|
-
}, t.value);
|
|
103
|
-
}) : /* @__PURE__ */ u("div", {
|
|
104
|
-
className: "rounded-[var(--radius-md)] border border-[color:var(--aui-card-border,var(--border))] bg-[color:color-mix(in_oklch,var(--muted),transparent_55%)] px-3 py-6 text-center text-sm text-muted-foreground",
|
|
105
|
-
children: _
|
|
106
|
-
})
|
|
107
|
-
})]
|
|
108
|
-
})]
|
|
109
|
-
})
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
//#endregion
|
|
113
|
-
export { f as Combobox };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("./input-decorator.cjs"),n=require("./input-value.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("lucide-react"),a=require("react/jsx-runtime");var o=r.forwardRef(({value:e,onChange:r,onValueChange:o,showIcon:s=!0,icon:c,leading:l,...u},d)=>{let f=n.createInputChangeHandler({onChange:r,onValueChange:o});return(0,a.jsx)(t.InputDecorator,{ref:d,type:`date`,value:n.getInputValue(e),leading:s?c??l??(0,a.jsx)(i.CalendarDaysIcon,{}):l,onChange:f,...u})});o.displayName=`DateInput`,exports.DateInput=o;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");function i({start:e,end:n,startClassName:i,endClassName:a,className:o,children:s,...c}){return(0,r.jsxs)(`div`,{"data-slot":`input-chrome`,className:t.cn(`flex h-11 w-full min-w-0 items-center rounded-[var(--aui-control-radius,var(--radius-md))] border border-[color:var(--aui-control-border-strong,var(--input))] bg-[color:var(--aui-control-surface,var(--background))] shadow-[var(--aui-control-shadow,none)] transition-[background-color,border-color,box-shadow] hover:border-[color:var(--aui-control-hover-border,var(--ring))] hover:bg-[color:var(--aui-control-surface-hover,var(--background))] focus-within:border-[color:var(--ring)] focus-within:shadow-[var(--aui-control-shadow,none),0_0_0_1px_var(--aui-focus-ring,var(--ring)),0_0_0_4px_var(--aui-focus-ring-soft,transparent)]`,o),...c,children:[e&&(0,r.jsx)(`span`,{className:t.cn(`shrink-0`,i),children:e}),s,n&&(0,r.jsx)(`span`,{className:t.cn(`shrink-0`,a),children:n})]})}exports.InputChrome=i;
|