@xjur-ui/react 1.0.0 → 1.0.1
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/.turbo/turbo-build.log +61 -57
- package/CHANGELOG.md +11 -0
- package/dist/components/avatar.d.ts +11 -0
- package/dist/components/avatar.js +58 -0
- package/dist/components/{ui/button.d.ts → button.d.ts} +2 -2
- package/dist/components/{ui/button.js → button.js} +9 -6
- package/dist/components/calendar.d.ts +11 -0
- package/dist/components/calendar.js +751 -0
- package/dist/components/checkbox.d.ts +8 -0
- package/dist/components/{ui/input/root.js → checkbox.js} +69 -79
- package/dist/components/chip.d.ts +24 -0
- package/dist/components/chip.js +255 -0
- package/dist/components/collapsible.d.ts +8 -0
- package/dist/components/collapsible.js +41 -0
- package/dist/components/date-picker.d.ts +20 -0
- package/dist/components/date-picker.js +230 -0
- package/dist/components/divider.d.ts +7 -0
- package/dist/components/divider.js +28 -0
- package/dist/components/dropdown-menu.d.ts +22 -0
- package/dist/components/dropdown-menu.js +294 -0
- package/dist/components/{resources/icons.d.ts → icon.d.ts} +11 -2
- package/dist/components/{ui/icon.js → icon.js} +18 -5
- package/dist/components/input.d.ts +32 -0
- package/dist/components/input.js +299 -0
- package/dist/components/list.d.ts +25 -0
- package/dist/components/{ui/input/content.js → list.js} +83 -87
- package/dist/components/{ui/logo.d.ts → logo.d.ts} +2 -2
- package/dist/components/{ui/logo.js → logo.js} +5 -5
- package/dist/components/{ui/otp-input.js → otp-input.js} +1 -1
- package/dist/components/radio.d.ts +10 -0
- package/dist/components/{ui/input/label.js → radio.js} +68 -77
- package/dist/components/search-input.d.ts +17 -0
- package/dist/components/search-input.js +274 -0
- package/dist/components/select.d.ts +33 -0
- package/dist/components/select.js +548 -0
- package/dist/components/sheet.d.ts +19 -0
- package/dist/components/sheet.js +251 -0
- package/dist/components/switch.d.ts +7 -0
- package/dist/components/switch.js +36 -0
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.js +54 -0
- package/dist/components/tag.d.ts +18 -0
- package/dist/components/tag.js +189 -0
- package/dist/components/{ui/typography.d.ts → typography.d.ts} +3 -3
- package/dist/components/{ui/typography.js → typography.js} +1 -1
- package/dist/index.css +1156 -62
- package/dist/index.d.ts +2 -17
- package/dist/index.js +0 -788
- package/eslint.config.js +8 -1
- package/package.json +40 -10
- package/src/components/avatar.tsx +53 -0
- package/src/components/{ui/button.tsx → button.tsx} +7 -5
- package/src/components/calendar.tsx +123 -0
- package/src/components/checkbox.tsx +57 -0
- package/src/components/chip.tsx +109 -0
- package/src/components/collapsible.tsx +35 -0
- package/src/components/date-picker.tsx +154 -0
- package/src/components/divider.tsx +23 -0
- package/src/components/dropdown-menu.tsx +101 -0
- package/src/components/{ui/icon.tsx → icon.tsx} +1 -1
- package/src/components/input.tsx +241 -0
- package/src/components/list.tsx +111 -0
- package/src/components/radio.tsx +74 -0
- package/src/components/search-input.tsx +112 -0
- package/src/components/select.tsx +234 -0
- package/src/components/sheet.tsx +141 -0
- package/src/components/switch.tsx +31 -0
- package/src/components/tabs.tsx +53 -0
- package/src/components/tag.tsx +91 -0
- package/src/index.css +4 -1
- package/src/index.ts +0 -1
- package/src/{components/resources → resources}/icons.ts +14 -1
- package/src/resources/input-mask.ts +91 -0
- package/dist/components/resources/icons.js +0 -133
- package/dist/components/resources/logo/horizontal.d.ts +0 -12
- package/dist/components/resources/logo/horizontal.js +0 -107
- package/dist/components/resources/logo/icon.d.ts +0 -12
- package/dist/components/resources/logo/icon.js +0 -79
- package/dist/components/resources/logo/index.d.ts +0 -4
- package/dist/components/resources/logo/index.js +0 -291
- package/dist/components/resources/logo/vertical.d.ts +0 -12
- package/dist/components/resources/logo/vertical.js +0 -107
- package/dist/components/ui/accordion.d.ts +0 -5
- package/dist/components/ui/accordion.js +0 -8
- package/dist/components/ui/icon.d.ts +0 -12
- package/dist/components/ui/index.d.ts +0 -17
- package/dist/components/ui/index.js +0 -788
- package/dist/components/ui/input/content.d.ts +0 -9
- package/dist/components/ui/input/index.d.ts +0 -12
- package/dist/components/ui/input/index.js +0 -335
- package/dist/components/ui/input/label.d.ts +0 -12
- package/dist/components/ui/input/message.d.ts +0 -10
- package/dist/components/ui/input/message.js +0 -128
- package/dist/components/ui/input/root.d.ts +0 -18
- package/dist/components/ui/input/slot.d.ts +0 -10
- package/dist/components/ui/input/slot.js +0 -20
- package/dist/components/ui/input/text.d.ts +0 -10
- package/dist/components/ui/input/text.js +0 -195
- package/src/components/ui/accordion.tsx +0 -3
- package/src/components/ui/index.ts +0 -13
- package/src/components/ui/input/content.tsx +0 -59
- package/src/components/ui/input/index.ts +0 -6
- package/src/components/ui/input/label.tsx +0 -41
- package/src/components/ui/input/message.tsx +0 -37
- package/src/components/ui/input/root.tsx +0 -57
- package/src/components/ui/input/slot.tsx +0 -21
- package/src/components/ui/input/text.tsx +0 -69
- /package/dist/components/{ui/otp-input.d.ts → otp-input.d.ts} +0 -0
- /package/src/components/{ui/logo.tsx → logo.tsx} +0 -0
- /package/src/components/{ui/otp-input.tsx → otp-input.tsx} +0 -0
- /package/src/components/{ui/typography.tsx → typography.tsx} +0 -0
- /package/src/{components/resources → resources}/logo/horizontal.tsx +0 -0
- /package/src/{components/resources → resources}/logo/icon.tsx +0 -0
- /package/src/{components/resources → resources}/logo/index.ts +0 -0
- /package/src/{components/resources → resources}/logo/vertical.tsx +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
// src/components/
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
// src/components/radio.tsx
|
|
2
|
+
import "react";
|
|
3
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
4
|
+
import { cx } from "@xjur-ui/util";
|
|
4
5
|
|
|
5
|
-
// src/components/
|
|
6
|
+
// src/components/typography.tsx
|
|
6
7
|
import { Slot } from "@radix-ui/react-slot";
|
|
7
8
|
import { cva } from "@xjur-ui/util";
|
|
8
9
|
import { memo } from "react";
|
|
@@ -78,88 +79,78 @@ var Typography = memo(
|
|
|
78
79
|
);
|
|
79
80
|
Typography.displayName = "Typography";
|
|
80
81
|
|
|
81
|
-
// src/components/
|
|
82
|
-
import {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
82
|
+
// src/components/radio.tsx
|
|
83
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
84
|
+
function RadioGroup({
|
|
85
|
+
className,
|
|
86
|
+
orientation = "vertical",
|
|
87
|
+
...props
|
|
88
|
+
}) {
|
|
89
|
+
return /* @__PURE__ */ jsx2(
|
|
90
|
+
RadioGroupPrimitive.Root,
|
|
91
|
+
{
|
|
92
|
+
className: cx(
|
|
93
|
+
"gap-small flex data-[orientation=horizontal]:flex-row data-[orientation=vertical]:flex-col",
|
|
94
|
+
className
|
|
95
|
+
),
|
|
96
|
+
"data-orientation": orientation,
|
|
97
|
+
"data-slot": "radio-group",
|
|
98
|
+
...props
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
function RadioItem({
|
|
103
|
+
className,
|
|
104
|
+
id,
|
|
105
|
+
label,
|
|
106
|
+
disabled = false,
|
|
107
|
+
...props
|
|
108
|
+
}) {
|
|
109
|
+
return /* @__PURE__ */ jsxs("div", { className: "gap-small flex items-center", children: [
|
|
110
|
+
/* @__PURE__ */ jsx2(
|
|
111
|
+
RadioGroupPrimitive.Item,
|
|
101
112
|
{
|
|
102
113
|
className: cx(
|
|
103
|
-
|
|
114
|
+
// layout
|
|
115
|
+
"size-large-alt rounded-circle inline-flex items-center justify-center transition-[border-color,box-shadow,background-color] duration-200 outline-none",
|
|
116
|
+
// base
|
|
117
|
+
"border-border-layer-2 bg-layer-2-idle cursor-pointer border-2",
|
|
118
|
+
// hover/focus (desmarcado)
|
|
119
|
+
"hover:border-primary-idle focus:border-primary-idle focus:shadow-focus-primary",
|
|
120
|
+
// estado checked
|
|
121
|
+
"data-[state=checked]:bg-primary-active data-[state=checked]:border-primary-active",
|
|
122
|
+
// hover quando estiver checked (opcional)
|
|
123
|
+
"data-[state=checked]:hover:border-primary-idle",
|
|
124
|
+
// disabled
|
|
125
|
+
"disabled:hover:border-border-layer-2 disabled:cursor-not-allowed disabled:opacity-[38%]",
|
|
104
126
|
className
|
|
105
127
|
),
|
|
106
|
-
"data-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
weight,
|
|
128
|
+
"data-slot": "radio-group-item",
|
|
129
|
+
disabled,
|
|
130
|
+
id,
|
|
110
131
|
...props,
|
|
111
|
-
children
|
|
132
|
+
children: /* @__PURE__ */ jsx2(
|
|
133
|
+
RadioGroupPrimitive.Indicator,
|
|
134
|
+
{
|
|
135
|
+
className: "relative flex items-center justify-center",
|
|
136
|
+
"data-slot": "radio-group-indicator"
|
|
137
|
+
}
|
|
138
|
+
)
|
|
112
139
|
}
|
|
113
|
-
)
|
|
114
|
-
|
|
115
|
-
);
|
|
116
|
-
InputMessage.displayName = "InputMessage";
|
|
117
|
-
|
|
118
|
-
// src/components/ui/input/root.tsx
|
|
119
|
-
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
120
|
-
var InputRootContext = createContext({});
|
|
121
|
-
function useInput() {
|
|
122
|
-
const context = use(InputRootContext);
|
|
123
|
-
if (!context) {
|
|
124
|
-
throw new Error(
|
|
125
|
-
"useInput must be called within <Input.Root> or <Select.Root>"
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
return context;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// src/components/ui/input/label.tsx
|
|
132
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
133
|
-
var InputLabel = memo3(
|
|
134
|
-
({
|
|
135
|
-
children,
|
|
136
|
-
htmlFor,
|
|
137
|
-
variant = "label",
|
|
138
|
-
weight = "medium",
|
|
139
|
-
size = "sm",
|
|
140
|
-
className,
|
|
141
|
-
...props
|
|
142
|
-
}) => {
|
|
143
|
-
const { errorMessage } = useInput();
|
|
144
|
-
return /* @__PURE__ */ jsx4(
|
|
140
|
+
),
|
|
141
|
+
!!label && /* @__PURE__ */ jsx2(
|
|
145
142
|
Typography,
|
|
146
143
|
{
|
|
147
144
|
asChild: true,
|
|
148
|
-
className:
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
)
|
|
152
|
-
"data-error": !!errorMessage,
|
|
153
|
-
size,
|
|
154
|
-
variant,
|
|
155
|
-
weight,
|
|
156
|
-
...props,
|
|
157
|
-
children: /* @__PURE__ */ jsx4("label", { htmlFor, children })
|
|
145
|
+
className: "text-size-body-sm data-[disabled=true]:opacity-38",
|
|
146
|
+
"data-disabled": disabled,
|
|
147
|
+
weight: "medium",
|
|
148
|
+
children: /* @__PURE__ */ jsx2("label", { htmlFor: id, children: label })
|
|
158
149
|
}
|
|
159
|
-
)
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
InputLabel.displayName = "InputLabel";
|
|
150
|
+
)
|
|
151
|
+
] });
|
|
152
|
+
}
|
|
163
153
|
export {
|
|
164
|
-
|
|
154
|
+
RadioGroup,
|
|
155
|
+
RadioItem
|
|
165
156
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
import { ButtonProps } from './button.js';
|
|
4
|
+
import 'class-variance-authority/types';
|
|
5
|
+
import '@xjur-ui/util';
|
|
6
|
+
|
|
7
|
+
type SearchInputProps = {
|
|
8
|
+
variant?: 'outlined' | 'line' | 'action';
|
|
9
|
+
};
|
|
10
|
+
declare function SearchInputRoot({ className, variant, ...props }: ComponentProps<'div'> & SearchInputProps): react_jsx_runtime.JSX.Element;
|
|
11
|
+
declare function SearchInputContent({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
12
|
+
declare function SearchInputLabel({ htmlFor, ...props }: ComponentProps<'label'>): react_jsx_runtime.JSX.Element;
|
|
13
|
+
declare function SearchInputText({ className, ...props }: ComponentProps<'input'>): react_jsx_runtime.JSX.Element;
|
|
14
|
+
declare function SearchInputSlot(props: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
15
|
+
declare function SearchInputAction({ className, appearance, variant, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { SearchInputAction, SearchInputContent, SearchInputLabel, type SearchInputProps, SearchInputRoot, SearchInputSlot, SearchInputText };
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
// src/components/search-input.tsx
|
|
2
|
+
import { cva as cva3, cx as cx2 } from "@xjur-ui/util";
|
|
3
|
+
import { createContext } from "react";
|
|
4
|
+
|
|
5
|
+
// src/components/typography.tsx
|
|
6
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
7
|
+
import { cva } from "@xjur-ui/util";
|
|
8
|
+
import { memo } from "react";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
var typographyVariants = cva("", {
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
body: "",
|
|
14
|
+
label: "",
|
|
15
|
+
title: "",
|
|
16
|
+
headline: ""
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
"sm-2x": "",
|
|
20
|
+
"sm-1x": "",
|
|
21
|
+
sm: "",
|
|
22
|
+
md: "",
|
|
23
|
+
lg: ""
|
|
24
|
+
},
|
|
25
|
+
weight: {
|
|
26
|
+
thin: "font-thin",
|
|
27
|
+
extraLight: "font-extralight",
|
|
28
|
+
light: "font-light",
|
|
29
|
+
normal: "font-normal",
|
|
30
|
+
medium: "font-medium",
|
|
31
|
+
semibold: "font-semibold",
|
|
32
|
+
bold: "font-bold",
|
|
33
|
+
extraBold: "font-extrabold",
|
|
34
|
+
black: "font-black"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
compoundVariants: [
|
|
38
|
+
{ variant: "body", size: "sm-1x", class: "text-size-body-sm-1x" },
|
|
39
|
+
{ variant: "body", size: "sm", class: "text-size-body-sm" },
|
|
40
|
+
{ variant: "body", size: "md", class: "text-size-body-md" },
|
|
41
|
+
{ variant: "body", size: "lg", class: "text-size-body-lg" },
|
|
42
|
+
{ variant: "label", size: "sm-2x", class: "text-size-label-sm-2x" },
|
|
43
|
+
{ variant: "label", size: "sm-1x", class: "text-size-label-sm-1x" },
|
|
44
|
+
{ variant: "label", size: "sm", class: "text-size-label-sm" },
|
|
45
|
+
{ variant: "label", size: "md", class: "text-size-label-md" },
|
|
46
|
+
{ variant: "label", size: "lg", class: "text-size-label-lg" },
|
|
47
|
+
{ variant: "title", size: "sm", class: "text-size-title-sm" },
|
|
48
|
+
{ variant: "title", size: "md", class: "text-size-title-md" },
|
|
49
|
+
{ variant: "title", size: "lg", class: "text-size-title-lg" },
|
|
50
|
+
{ variant: "headline", size: "sm", class: "text-size-headline-sm" },
|
|
51
|
+
{ variant: "headline", size: "md", class: "text-size-headline-md" },
|
|
52
|
+
{ variant: "headline", size: "lg", class: "text-size-headline-lg" }
|
|
53
|
+
],
|
|
54
|
+
defaultVariants: {
|
|
55
|
+
variant: "body",
|
|
56
|
+
size: "md",
|
|
57
|
+
weight: "normal"
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
var Typography = memo(
|
|
61
|
+
({
|
|
62
|
+
variant,
|
|
63
|
+
size,
|
|
64
|
+
weight,
|
|
65
|
+
asChild,
|
|
66
|
+
className,
|
|
67
|
+
...props
|
|
68
|
+
}) => {
|
|
69
|
+
const Component = asChild ? Slot : "span";
|
|
70
|
+
return /* @__PURE__ */ jsx(
|
|
71
|
+
Component,
|
|
72
|
+
{
|
|
73
|
+
className: typographyVariants({ variant, size, weight, className }),
|
|
74
|
+
...props
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
Typography.displayName = "Typography";
|
|
80
|
+
|
|
81
|
+
// src/components/button.tsx
|
|
82
|
+
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
83
|
+
import { cva as cva2, cx } from "@xjur-ui/util";
|
|
84
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
85
|
+
var buttonVariants = cva2(
|
|
86
|
+
[
|
|
87
|
+
"outline-none inline-flex items-center justify-center rounded-circle gap-small cursor-pointer disabled:opacity-38 disabled:pointer-events-none transition-colors"
|
|
88
|
+
],
|
|
89
|
+
{
|
|
90
|
+
variants: {
|
|
91
|
+
size: {
|
|
92
|
+
md: "py-small_1x-alt px-medium text-size-body-md",
|
|
93
|
+
sm: "py-small-1x px-small text-size-label-sm",
|
|
94
|
+
icon_md: "p-small text-size-body-md h-large-4x w-large-4x",
|
|
95
|
+
icon_sm: "p-small-1x text-size-label-sm h-large-2x w-large-2x"
|
|
96
|
+
},
|
|
97
|
+
variant: {
|
|
98
|
+
primary: "",
|
|
99
|
+
secondary: "",
|
|
100
|
+
tertiary: "",
|
|
101
|
+
destructive: "",
|
|
102
|
+
outlined: "bg-layer-2-idle border border-border-layer-2 hover:bg-layer-2-hover active:bg-layer-2-pressed"
|
|
103
|
+
},
|
|
104
|
+
appearance: {
|
|
105
|
+
solid: "",
|
|
106
|
+
ghost: "bg-transparent"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
compoundVariants: [
|
|
110
|
+
{
|
|
111
|
+
variant: "primary",
|
|
112
|
+
appearance: "solid",
|
|
113
|
+
class: "bg-primary-idle text-neutral-label hover:bg-primary-hover active:bg-primary-pressed"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
variant: "primary",
|
|
117
|
+
appearance: "ghost",
|
|
118
|
+
class: "text-primary-idle hover:bg-primary-alt-idle active:bg-primary-alt-pressed"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
variant: "secondary",
|
|
122
|
+
appearance: "solid",
|
|
123
|
+
class: "bg-layer-1-hover text-neutral-dark hover:bg-layer-1-pressed active:bg-layer-1-active"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
variant: "secondary",
|
|
127
|
+
appearance: "ghost",
|
|
128
|
+
class: "hover:bg-layer-1-hover active:bg-layer-1-pressed"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
variant: "tertiary",
|
|
132
|
+
appearance: "solid",
|
|
133
|
+
class: "bg-layer-2-hover text-neutral-dark hover:bg-layer-2-pressed active:bg-layer-2-active"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
variant: "tertiary",
|
|
137
|
+
appearance: "ghost",
|
|
138
|
+
class: "hover:bg-layer-2-hover active:bg-layer-2-pressed"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
variant: "destructive",
|
|
142
|
+
appearance: "solid",
|
|
143
|
+
class: "bg-danger-idle text-neutral-label hover:bg-danger-hover active:bg-danger-pressed"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
variant: "destructive",
|
|
147
|
+
appearance: "ghost",
|
|
148
|
+
class: "text-danger-label-idle hover:bg-danger-alt-idle active:bg-danger-alt-pressed"
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
defaultVariants: {
|
|
152
|
+
size: "md",
|
|
153
|
+
variant: "primary",
|
|
154
|
+
appearance: "solid"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
function Button({
|
|
159
|
+
asChild,
|
|
160
|
+
className,
|
|
161
|
+
variant = "primary",
|
|
162
|
+
size = "md",
|
|
163
|
+
appearance = "solid",
|
|
164
|
+
...props
|
|
165
|
+
}) {
|
|
166
|
+
const Component = asChild ? Slot2 : "button";
|
|
167
|
+
return /* @__PURE__ */ jsx2(
|
|
168
|
+
Component,
|
|
169
|
+
{
|
|
170
|
+
className: cx(buttonVariants({ variant, appearance, size }), className),
|
|
171
|
+
...props
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// src/components/search-input.tsx
|
|
177
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
178
|
+
var SearchInputRootContext = createContext({
|
|
179
|
+
variant: "outlined"
|
|
180
|
+
});
|
|
181
|
+
function SearchInputRoot({
|
|
182
|
+
className,
|
|
183
|
+
variant = "outlined",
|
|
184
|
+
...props
|
|
185
|
+
}) {
|
|
186
|
+
return /* @__PURE__ */ jsx3(SearchInputRootContext.Provider, { value: { variant }, children: /* @__PURE__ */ jsx3("div", { className: cx2(className, "relative flex w-full"), ...props }) });
|
|
187
|
+
}
|
|
188
|
+
function SearchInputContent({
|
|
189
|
+
className,
|
|
190
|
+
...props
|
|
191
|
+
}) {
|
|
192
|
+
const contentVarians = cva3(
|
|
193
|
+
[
|
|
194
|
+
"gap-small py-small_1x-alt px-small flex items-center w-full",
|
|
195
|
+
"h-large-4x rounded-circle",
|
|
196
|
+
"border-border-layer-2 placeholder:placeholder-neutral-placeholder text-size-body-md text-neutral-dark border font-normal",
|
|
197
|
+
"group-hover:border-border-layer-3 transition-colors duration-200",
|
|
198
|
+
"disabled:opacity-60",
|
|
199
|
+
"focus-within:border-primary-idle"
|
|
200
|
+
],
|
|
201
|
+
{
|
|
202
|
+
variants: {
|
|
203
|
+
variant: {
|
|
204
|
+
outlined: "rounded-circle focus-within:border-primary-idle focus-within:shadow-focus-primary",
|
|
205
|
+
line: "rounded-none border-t-0 border-b-1 border-x-0",
|
|
206
|
+
action: "rounded-tr-none rounded-br-none border-r-0"
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
return /* @__PURE__ */ jsx3(SearchInputRootContext.Consumer, { children: ({ variant }) => /* @__PURE__ */ jsx3(
|
|
212
|
+
"div",
|
|
213
|
+
{
|
|
214
|
+
className: cx2(className, contentVarians({ variant })),
|
|
215
|
+
"data-variant": variant,
|
|
216
|
+
...props
|
|
217
|
+
}
|
|
218
|
+
) });
|
|
219
|
+
}
|
|
220
|
+
function SearchInputLabel({
|
|
221
|
+
htmlFor,
|
|
222
|
+
...props
|
|
223
|
+
}) {
|
|
224
|
+
return /* @__PURE__ */ jsx3(
|
|
225
|
+
Typography,
|
|
226
|
+
{
|
|
227
|
+
asChild: true,
|
|
228
|
+
className: cx2("absolute -top-[22px] left-0"),
|
|
229
|
+
size: "sm",
|
|
230
|
+
variant: "label",
|
|
231
|
+
weight: "medium",
|
|
232
|
+
children: /* @__PURE__ */ jsx3("label", { htmlFor, ...props })
|
|
233
|
+
}
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
function SearchInputText({
|
|
237
|
+
className,
|
|
238
|
+
...props
|
|
239
|
+
}) {
|
|
240
|
+
return /* @__PURE__ */ jsx3("input", { className: cx2(className, "flex-1 outline-none"), ...props });
|
|
241
|
+
}
|
|
242
|
+
function SearchInputSlot(props) {
|
|
243
|
+
return /* @__PURE__ */ jsx3("div", { ...props, "data-slot": "search-input-slot" });
|
|
244
|
+
}
|
|
245
|
+
function SearchInputAction({
|
|
246
|
+
className,
|
|
247
|
+
appearance = "ghost",
|
|
248
|
+
variant = "outlined",
|
|
249
|
+
...props
|
|
250
|
+
}) {
|
|
251
|
+
return /* @__PURE__ */ jsx3(
|
|
252
|
+
Button,
|
|
253
|
+
{
|
|
254
|
+
...props,
|
|
255
|
+
appearance,
|
|
256
|
+
className: cx2(
|
|
257
|
+
className,
|
|
258
|
+
"cursor-pointer",
|
|
259
|
+
"h-large-4x rounded-tr-circle rounded-br-circle px-small py-small_1x-alt flex items-center justify-center rounded-none",
|
|
260
|
+
"text-size-body-md text-neutral-dark gap-small-1x"
|
|
261
|
+
),
|
|
262
|
+
"data-slot": "search-input-action",
|
|
263
|
+
variant
|
|
264
|
+
}
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
export {
|
|
268
|
+
SearchInputAction,
|
|
269
|
+
SearchInputContent,
|
|
270
|
+
SearchInputLabel,
|
|
271
|
+
SearchInputRoot,
|
|
272
|
+
SearchInputSlot,
|
|
273
|
+
SearchInputText
|
|
274
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
import * as RadixPopover from '@radix-ui/react-popover';
|
|
4
|
+
import { ListContent, ListItem, ListHeader, ListHeaderTitle } from './list.js';
|
|
5
|
+
import { SearchInputText } from './search-input.js';
|
|
6
|
+
import { TypographyProps, Typography } from './typography.js';
|
|
7
|
+
import 'class-variance-authority/types';
|
|
8
|
+
import '@xjur-ui/util';
|
|
9
|
+
import './button.js';
|
|
10
|
+
|
|
11
|
+
declare function SelectRoot(props: ComponentProps<typeof RadixPopover.Root>): react_jsx_runtime.JSX.Element;
|
|
12
|
+
declare function SelectTrigger({ className, ...props }: ComponentProps<typeof RadixPopover.Trigger>): react_jsx_runtime.JSX.Element;
|
|
13
|
+
declare function SelectContent({ className, children, sideOffset, side, align, ...props }: ComponentProps<typeof RadixPopover.Content>): react_jsx_runtime.JSX.Element;
|
|
14
|
+
declare function SelectValue({ className, displayValue, ...props }: ComponentProps<'input'> & {
|
|
15
|
+
displayValue?: string;
|
|
16
|
+
}): react_jsx_runtime.JSX.Element;
|
|
17
|
+
declare function SelectMultiValue({ className, values, children, ...props }: ComponentProps<'div'> & {
|
|
18
|
+
values: string[];
|
|
19
|
+
}): react_jsx_runtime.JSX.Element;
|
|
20
|
+
declare function SelectLabel({ className, htmlFor, children, ...props }: TypographyProps & {
|
|
21
|
+
htmlFor?: string;
|
|
22
|
+
}): react_jsx_runtime.JSX.Element;
|
|
23
|
+
declare function SelectOptions(props: ComponentProps<typeof ListContent>): react_jsx_runtime.JSX.Element;
|
|
24
|
+
declare function SelectOption({ className, ...props }: ComponentProps<typeof ListItem>): react_jsx_runtime.JSX.Element;
|
|
25
|
+
declare function SelectOptionText(props: ComponentProps<typeof Typography>): react_jsx_runtime.JSX.Element;
|
|
26
|
+
declare function SelectHeader(props: ComponentProps<typeof ListHeader>): react_jsx_runtime.JSX.Element;
|
|
27
|
+
declare function SelectHeaderTitle(props: ComponentProps<typeof ListHeaderTitle>): react_jsx_runtime.JSX.Element;
|
|
28
|
+
declare function SelectDropdown(props: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
29
|
+
declare function SelectLeftSlot({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
30
|
+
declare function SelectRightSlot({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
31
|
+
declare function SelectSearch(props: ComponentProps<typeof SearchInputText>): react_jsx_runtime.JSX.Element;
|
|
32
|
+
|
|
33
|
+
export { SelectContent, SelectDropdown, SelectHeader, SelectHeaderTitle, SelectLabel, SelectLeftSlot, SelectMultiValue, SelectOption, SelectOptionText, SelectOptions, SelectRightSlot, SelectRoot, SelectSearch, SelectTrigger, SelectValue };
|