@petnow/ui 5.1.0 → 5.3.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/CHANGELOG.md +50 -0
- package/README.md +10 -8
- package/dist/{Popup-B2Q-le-6.js → Popup-DRf-ERpL.js} +3 -3
- package/dist/Popup-DRf-ERpL.js.map +1 -0
- package/dist/badge.js +338 -0
- package/dist/badge.js.map +1 -0
- package/dist/checkbox.js +38 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/chip.js +53 -0
- package/dist/chip.js.map +1 -0
- package/dist/combobox.js +201 -0
- package/dist/combobox.js.map +1 -0
- package/dist/cta-button.js +62 -0
- package/dist/cta-button.js.map +1 -0
- package/dist/fieldStyles-DyZu__hI.js +42 -0
- package/dist/fieldStyles-DyZu__hI.js.map +1 -0
- package/dist/icons/action/cancel-filled.js +22 -0
- package/dist/icons/action/cancel-filled.js.map +1 -0
- package/dist/icons/action/cancel.js +19 -0
- package/dist/icons/action/cancel.js.map +1 -0
- package/dist/icons/action/chevron-down.js +19 -0
- package/dist/icons/action/chevron-down.js.map +1 -0
- package/dist/icons/action/chevron-left.js +19 -0
- package/dist/icons/action/chevron-left.js.map +1 -0
- package/dist/icons/action/chevron-right.js +19 -0
- package/dist/icons/action/chevron-right.js.map +1 -0
- package/dist/icons/action/chevron-up.js +19 -0
- package/dist/icons/action/chevron-up.js.map +1 -0
- package/dist/icons/action/filter.js +19 -0
- package/dist/icons/action/filter.js.map +1 -0
- package/dist/icons/action/retry.js +19 -0
- package/dist/icons/action/retry.js.map +1 -0
- package/dist/icons/action/sorting.js +19 -0
- package/dist/icons/action/sorting.js.map +1 -0
- package/dist/icons/static/close.js +19 -0
- package/dist/icons/static/close.js.map +1 -0
- package/dist/icons/static/delete.js +30 -0
- package/dist/icons/static/delete.js.map +1 -0
- package/dist/icons/static/recent.js +32 -0
- package/dist/icons/static/recent.js.map +1 -0
- package/dist/icons/static/report.js +28 -0
- package/dist/icons/static/report.js.map +1 -0
- package/dist/icons/static/shield-done.js +21 -0
- package/dist/icons/static/shield-done.js.map +1 -0
- package/dist/index.d.ts +25 -23
- package/dist/index.es.js +26 -24
- package/dist/mergeRefs-BHwdBwNQ.js +27 -0
- package/dist/mergeRefs-BHwdBwNQ.js.map +1 -0
- package/dist/popup.js +4 -0
- package/dist/radio.js +17 -0
- package/dist/radio.js.map +1 -0
- package/dist/select.js +82 -0
- package/dist/select.js.map +1 -0
- package/dist/src/components/checkbox/Checkbox.d.ts +11 -0
- package/dist/src/components/combobox/Combobox.d.ts +35 -0
- package/dist/src/components/select/Select.d.ts +24 -0
- package/dist/src/components/ui/field.d.ts +15 -0
- package/dist/src/components/ui/fieldStyles.d.ts +14 -0
- package/dist/src/utils/mergeRefs.d.ts +2 -0
- package/dist/tabs.js +73 -0
- package/dist/tabs.js.map +1 -0
- package/dist/text-field.js +252 -0
- package/dist/text-field.js.map +1 -0
- package/dist/toggle.js +21 -0
- package/dist/toggle.js.map +1 -0
- package/dist/v0/checkbox.js +1 -38
- package/dist/v0/radio.js +1 -17
- package/dist/v0/tabs.js +1 -73
- package/dist/v0/toggle.js +1 -21
- package/dist/v1/badge.js +1 -338
- package/dist/v1/chip.js +1 -53
- package/dist/v1/cta-button.js +1 -62
- package/dist/v1/icons/action/cancel-filled.js +1 -22
- package/dist/v1/icons/action/cancel.js +1 -19
- package/dist/v1/icons/action/chevron-down.js +1 -19
- package/dist/v1/icons/action/chevron-left.js +1 -19
- package/dist/v1/icons/action/chevron-right.js +1 -19
- package/dist/v1/icons/action/chevron-up.js +1 -19
- package/dist/v1/icons/action/filter.js +1 -19
- package/dist/v1/icons/action/retry.js +1 -19
- package/dist/v1/icons/action/sorting.js +1 -19
- package/dist/v1/icons/static/close.js +1 -19
- package/dist/v1/icons/static/delete.js +1 -30
- package/dist/v1/icons/static/recent.js +1 -32
- package/dist/v1/icons/static/report.js +1 -28
- package/dist/v1/icons/static/shield-done.js +1 -21
- package/dist/v1/popup.js +1 -4
- package/dist/v1/text-field.js +1 -286
- package/package.json +149 -48
- package/dist/Popup-B2Q-le-6.js.map +0 -1
- package/dist/src/components/v0/checkbox/Checkbox.d.ts +0 -10
- package/dist/v0/checkbox.js.map +0 -1
- package/dist/v0/radio.js.map +0 -1
- package/dist/v0/tabs.js.map +0 -1
- package/dist/v0/toggle.js.map +0 -1
- package/dist/v1/badge.js.map +0 -1
- package/dist/v1/chip.js.map +0 -1
- package/dist/v1/cta-button.js.map +0 -1
- package/dist/v1/icons/action/cancel-filled.js.map +0 -1
- package/dist/v1/icons/action/cancel.js.map +0 -1
- package/dist/v1/icons/action/chevron-down.js.map +0 -1
- package/dist/v1/icons/action/chevron-left.js.map +0 -1
- package/dist/v1/icons/action/chevron-right.js.map +0 -1
- package/dist/v1/icons/action/chevron-up.js.map +0 -1
- package/dist/v1/icons/action/filter.js.map +0 -1
- package/dist/v1/icons/action/retry.js.map +0 -1
- package/dist/v1/icons/action/sorting.js.map +0 -1
- package/dist/v1/icons/static/close.js.map +0 -1
- package/dist/v1/icons/static/delete.js.map +0 -1
- package/dist/v1/icons/static/recent.js.map +0 -1
- package/dist/v1/icons/static/report.js.map +0 -1
- package/dist/v1/icons/static/shield-done.js.map +0 -1
- package/dist/v1/text-field.js.map +0 -1
- /package/dist/src/components/{v1/badge → badge}/Badge.d.ts +0 -0
- /package/dist/src/components/{v1/chip → chip}/Chip.d.ts +0 -0
- /package/dist/src/components/{v1/cta-button → cta-button}/CTAButton.d.ts +0 -0
- /package/dist/src/components/{v1/icons → icons}/action/CancelFilledIcon.d.ts +0 -0
- /package/dist/src/components/{v1/icons → icons}/action/CancelIcon.d.ts +0 -0
- /package/dist/src/components/{v1/icons → icons}/action/ChevronDownIcon.d.ts +0 -0
- /package/dist/src/components/{v1/icons → icons}/action/ChevronLeftIcon.d.ts +0 -0
- /package/dist/src/components/{v1/icons → icons}/action/ChevronRightIcon.d.ts +0 -0
- /package/dist/src/components/{v1/icons → icons}/action/ChevronUpIcon.d.ts +0 -0
- /package/dist/src/components/{v1/icons → icons}/action/FilterIcon.d.ts +0 -0
- /package/dist/src/components/{v1/icons → icons}/action/RetryIcon.d.ts +0 -0
- /package/dist/src/components/{v1/icons → icons}/action/SortingIcon.d.ts +0 -0
- /package/dist/src/components/{v1/icons → icons}/static/CloseIcon.d.ts +0 -0
- /package/dist/src/components/{v1/icons → icons}/static/DeleteIcon.d.ts +0 -0
- /package/dist/src/components/{v1/icons → icons}/static/RecentIcon.d.ts +0 -0
- /package/dist/src/components/{v1/icons → icons}/static/ReportIcon.d.ts +0 -0
- /package/dist/src/components/{v1/icons → icons}/static/ShieldDoneIcon.d.ts +0 -0
- /package/dist/src/components/{v1/popup → popup}/Popup.d.ts +0 -0
- /package/dist/src/components/{v0/radio → radio}/Radio.d.ts +0 -0
- /package/dist/src/components/{v0/tabs → tabs}/Tabs.d.ts +0 -0
- /package/dist/src/components/{v1/text-field → text-field}/TextField.d.ts +0 -0
- /package/dist/src/components/{v0/toggle → toggle}/Toggle.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.3.0
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **`Select`** (`@petnow/ui/select`): pick one option from a list. It is a native `<select>` styled like
|
|
8
|
+
`TextField`, so it keeps the mobile picker, form validation (`required`) and keyboard behavior of the
|
|
9
|
+
browser. Props: `label`, `options` (`string` or `{ value, label, disabled }`), `value` / `defaultValue`,
|
|
10
|
+
`onChange(value)`, `placeholder`, `errorText`, `assistiveText`, `size` (`large` | `small`), plus every
|
|
11
|
+
`<select>` attribute and `ref`.
|
|
12
|
+
- **`Combobox`** (`@petnow/ui/combobox`): type to search and pick one option (WAI-ARIA combobox with list
|
|
13
|
+
autocomplete). Focus stays in the input and the active option is announced with
|
|
14
|
+
`aria-activedescendant`. Only a picked option becomes `value`; typing after a pick calls
|
|
15
|
+
`onChange("")`, and text equal to an option label (for example from browser autofill) picks it.
|
|
16
|
+
Escape and blur discard the query, and a new `value` from outside (a form reset) replaces it. IME
|
|
17
|
+
composition keys (Korean, Japanese) never pick an option. With `required`, text that is not a picked
|
|
18
|
+
option fails browser validation (`invalidSelectionText`). It is controlled only (`value` and
|
|
19
|
+
`onChange`; no `defaultValue`). Other props as `Select`, plus `filter`, `emptyText`, `toggleLabel` and
|
|
20
|
+
`name` (submitted through a hidden input with the picked value). The list is positioned below the input,
|
|
21
|
+
so a parent with `overflow: hidden` clips it.
|
|
22
|
+
- Both are tagged `source-dev` in Storybook: they follow `TextField`, not a separate design baseline.
|
|
23
|
+
|
|
24
|
+
### Changes
|
|
25
|
+
|
|
26
|
+
- `Checkbox` accepts `ref` (React 19 ref prop), which reaches the `<input>`. Without `isChecked` it is
|
|
27
|
+
uncontrolled and `defaultChecked` sets the first state.
|
|
28
|
+
- `Checkbox` is dimmed (`opacity-50`, box and check mark) and shows a not-allowed cursor when
|
|
29
|
+
`disabled`. A consumer `disabled:opacity-*` class still wins for the box.
|
|
30
|
+
- `TextField` shares its field styles with `Select` and `Combobox`. Its classes are unchanged.
|
|
31
|
+
|
|
32
|
+
## 5.2.0
|
|
33
|
+
|
|
34
|
+
### Changes
|
|
35
|
+
|
|
36
|
+
- **Components no longer have a version in their path.** v0 (`Checkbox`, `Radio`, `Tabs`, `Toggle`) and v1
|
|
37
|
+
(`Badge`, `Chip`, `CTAButton`, `Popup`, `TextField`, icons) are one set. Import a single component from
|
|
38
|
+
`@petnow/ui/<name>` (`@petnow/ui/checkbox`, `@petnow/ui/cta-button`) and an icon from
|
|
39
|
+
`@petnow/ui/icons/<action|static>/<name>` (`@petnow/ui/icons/action/chevron-left`). The root import
|
|
40
|
+
`@petnow/ui` is unchanged.
|
|
41
|
+
- **`@petnow/ui/v0/*` and `@petnow/ui/v1/*` are deprecated.** They still work: each one points to the same
|
|
42
|
+
module as its new path, so the two paths give the same component. They will be removed in the next major.
|
|
43
|
+
To migrate, delete `v0/` and `v1/` from the import path.
|
|
44
|
+
- The built files moved from `dist/v0/<name>.js` and `dist/v1/<name>.js` to `dist/<name>.js` (icons: from
|
|
45
|
+
`dist/v1/icons/<group>/<name>.js` to `dist/icons/<group>/<name>.js`). The old files are still built as
|
|
46
|
+
re-exports of the new ones and will be removed with the `v0`/`v1` paths. The type declarations moved from
|
|
47
|
+
`dist/src/components/v0|v1/...` to `dist/src/components/...`.
|
|
48
|
+
- Storybook titles drop the version: `Components/v0/Checkbox` is now `Components/Checkbox`, so story URLs change.
|
|
49
|
+
|
|
50
|
+
The token files keep their version. `tailwind.css` v0 tokens stay deprecated, and
|
|
51
|
+
`petnow-design-system-v1.css` keeps its name.
|
|
52
|
+
|
|
3
53
|
## 5.1.0
|
|
4
54
|
|
|
5
55
|
### Changes
|
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
`@petnow/ui/tailwind.css`는 토큰·유틸리티를 추가하고 패키지 `dist`를 `@source`로 등록한다. Tailwind,
|
|
25
25
|
폰트, base 스타일, shadcn 변수, 다크 모드 설정은 넣지 않는다. 이것들은 소비 레포가 정한다.
|
|
26
26
|
|
|
27
|
-
3.
|
|
27
|
+
3. `Radio`나 `.scrollbar`, `.popup-scrollbar`, `.ja-break-all`, `.global-break-all` 클래스를 쓰면 일반 CSS도
|
|
28
28
|
import한다.
|
|
29
29
|
|
|
30
30
|
```tsx
|
|
@@ -38,9 +38,12 @@
|
|
|
38
38
|
```tsx
|
|
39
39
|
import { CTAButton } from "@petnow/ui";
|
|
40
40
|
// 또는 개별 경로
|
|
41
|
-
import { CTAButton } from "@petnow/ui/
|
|
41
|
+
import { CTAButton } from "@petnow/ui/cta-button";
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
+
개별 경로는 `@petnow/ui/<컴포넌트>`, 아이콘은 `@petnow/ui/icons/<action|static>/<이름>`이다. 5.1까지 쓰던
|
|
45
|
+
`@petnow/ui/v0/*`, `@petnow/ui/v1/*` 경로도 같은 모듈을 가리키지만 deprecated이고, 다음 major에서 지운다.
|
|
46
|
+
|
|
44
47
|
Petify 테마는 상위 요소에 `petify` 클래스를 붙이면 v1 시맨틱 컬러가 바뀐다.
|
|
45
48
|
|
|
46
49
|
## 구조
|
|
@@ -52,16 +55,15 @@ Petify 테마는 상위 요소에 `petify` 클래스를 붙이면 v1 시맨틱
|
|
|
52
55
|
├── index.ts - 패키지 엔트리
|
|
53
56
|
├── src
|
|
54
57
|
│ ├── components
|
|
55
|
-
│ │ ├── ui
|
|
56
|
-
│ │ ├──
|
|
57
|
-
│ │ └──
|
|
58
|
+
│ │ ├── ui - 내부 전용 primitive (export하지 않음)
|
|
59
|
+
│ │ ├── icons - 아이콘 (action, static)
|
|
60
|
+
│ │ └── <컴포넌트> - 컴포넌트와 스토리 (badge, checkbox, cta-button, …)
|
|
58
61
|
│ ├── styles/components.css - dist/index.css로 복사되는 일반 CSS
|
|
59
62
|
│ ├── index.css - Storybook 엔트리
|
|
60
63
|
│ └── utils
|
|
61
64
|
├── test
|
|
62
|
-
│ ├── css
|
|
63
|
-
│
|
|
64
|
-
│ └── v1
|
|
65
|
+
│ ├── css - 소비 레포 방식으로 패키지 CSS를 빌드해 보는 테스트
|
|
66
|
+
│ └── components - 컴포넌트 테스트
|
|
65
67
|
└── docs
|
|
66
68
|
├── adr
|
|
67
69
|
└── migration
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as e } from "./TailwindUtil-DiNvXuNl.js";
|
|
3
|
-
import { CTAButton as t } from "./
|
|
3
|
+
import { CTAButton as t } from "./cta-button.js";
|
|
4
4
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
5
|
import * as i from "react";
|
|
6
6
|
import { Dialog as a } from "radix-ui";
|
|
@@ -34,7 +34,7 @@ var d = i.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n(a.Descript
|
|
|
34
34
|
}));
|
|
35
35
|
d.displayName = a.Description.displayName;
|
|
36
36
|
//#endregion
|
|
37
|
-
//#region src/components/
|
|
37
|
+
//#region src/components/popup/Popup.tsx
|
|
38
38
|
var f = ({ isOpen: i, setIsOpen: a, onClose: s, title: c, description: f, content: p, confirm: m, cancel: h, preventEasyClose: g = !1, className: _ }) => {
|
|
39
39
|
let v = () => {
|
|
40
40
|
a(!1), s?.();
|
|
@@ -93,4 +93,4 @@ var f = ({ isOpen: i, setIsOpen: a, onClose: s, title: c, description: f, conten
|
|
|
93
93
|
//#endregion
|
|
94
94
|
export { f as t };
|
|
95
95
|
|
|
96
|
-
//# sourceMappingURL=Popup-
|
|
96
|
+
//# sourceMappingURL=Popup-DRf-ERpL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popup-DRf-ERpL.js","names":[],"sources":["../src/components/ui/dialog.tsx","../src/components/popup/Popup.tsx"],"sourcesContent":["import { Dialog as DialogPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { cn } from \"@/utils/TailwindUtil\";\n\nconst Dialog = DialogPrimitive.Root;\nconst DialogTrigger = DialogPrimitive.Trigger;\nconst DialogPortal = DialogPrimitive.Portal;\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n // TODO(PROD-662): 오버레이(dim) 시맨틱 토큰이 없어 기존 색을 유지한다. 토큰 추가 후 교체.\n // eslint-disable-next-line design-tokens/no-hardcoded-color\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-[#2c2f34]/40 duration-200\",\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bg-surface-base-neutral-1 fixed top-1/2 left-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg p-6 shadow-lg duration-200 outline-none\",\n className,\n )}\n {...props}\n />\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nfunction DialogHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(\"flex flex-col gap-2\", className)} {...props} />;\n}\n\nfunction DialogFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(\"flex flex-col gap-2 sm:flex-row sm:justify-end\", className)} {...props} />;\n}\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title ref={ref} className={cn(\"text-lg font-semibold\", className)} {...props} />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\"text-text-prominent-neutral-3 text-sm\", className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"../../utils/TailwindUtil\";\nimport { CTAButton } from \"../cta-button/CTAButton\";\n\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"@/components/ui/dialog\";\n\ntype PopupAction = {\n label: string | React.ReactNode;\n icon?: React.ComponentType<{ className?: string }>;\n onClick?: () => void;\n};\n\nexport interface PopupProps {\n isOpen: boolean;\n setIsOpen: (isOpen: boolean) => void;\n onClose?: () => void;\n title?: string | React.ReactNode;\n description?: string | React.ReactNode;\n content?: React.ReactNode;\n confirm?: PopupAction;\n cancel?: PopupAction;\n preventEasyClose?: boolean;\n className?: string;\n}\n\nconst Popup = ({\n isOpen,\n setIsOpen,\n onClose,\n title,\n description,\n content,\n confirm,\n cancel,\n preventEasyClose = false,\n className,\n}: PopupProps) => {\n const handleClose = () => {\n setIsOpen(false);\n onClose?.();\n };\n\n const handleConfirmAction = (action?: PopupAction) => () => {\n action?.onClick?.();\n };\n\n const handleCancelAction = (action?: PopupAction) => () => {\n action?.onClick?.();\n handleClose();\n };\n\n const handleOpenChange = (nextOpen: boolean) => {\n if (preventEasyClose && !nextOpen) {\n return;\n }\n\n if (!nextOpen) {\n onClose?.();\n }\n\n setIsOpen(nextOpen);\n };\n\n return (\n <Dialog open={isOpen} onOpenChange={handleOpenChange}>\n <DialogContent\n onEscapeKeyDown={preventEasyClose ? (event) => event.preventDefault() : undefined}\n onInteractOutside={preventEasyClose ? (event) => event.preventDefault() : undefined}\n className={cn(\n \"bg-surface-base-neutral-1 flex max-h-[440px] w-[300px] max-w-[300px] flex-col gap-4 overflow-hidden rounded-[16px] p-4\",\n className,\n )}\n >\n <div className=\"flex w-full flex-col gap-2 overflow-y-auto\">\n {title && <DialogTitle className=\"text-title-18-bold text-text-prominent-neutral-4\">{title}</DialogTitle>}\n {description && (\n <div className=\"overflow-y-auto\">\n <DialogDescription className=\"text-body-16-medium text-text-prominent-neutral-3\">\n {description}\n </DialogDescription>\n </div>\n )}\n {content && <div className=\"overflow-y-auto\">{content}</div>}\n </div>\n {(confirm || cancel) && (\n <div className=\"flex w-full flex-col gap-2\">\n {confirm && (\n <CTAButton\n label={confirm.label}\n icon={confirm.icon}\n size=\"medium\"\n hierarchy=\"primary\"\n onClick={handleConfirmAction(confirm)}\n />\n )}\n {cancel && (\n <CTAButton\n label={cancel.label}\n icon={cancel.icon}\n size=\"medium\"\n hierarchy=\"tertiary\"\n onClick={handleCancelAction(cancel)}\n />\n )}\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n};\n\nexport { Popup };\n"],"mappings":";;;;;;;AAKA,IAAM,IAAS,EAAgB;AACT,EAAgB;AACtC,IAAM,IAAe,EAAgB;AACjB,EAAgB;AAEpC,IAAM,IAAgB,EAAM,YAGzB,EAAE,cAAW,GAAG,KAAS,MAC1B,kBAAC,EAAgB,SAAjB;CACO;CACL,WAAW,EAGT,2KACA,CACF;CACA,GAAI;AACL,CAAA,CACF;AACD,EAAc,cAAc,EAAgB,QAAQ;AAEpD,IAAM,IAAgB,EAAM,YAGzB,EAAE,cAAW,GAAG,KAAS,MAC1B,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,CAAgB,CAAA,GAChB,kBAAC,EAAgB,SAAjB;CACO;CACL,WAAW,EACT,4RACA,CACF;CACA,GAAI;AACL,CAAA,CACW,EAAA,CAAA,CACf;AACD,EAAc,cAAc,EAAgB,QAAQ;AAUpD,IAAM,IAAc,EAAM,YAGvB,EAAE,cAAW,GAAG,KAAS,MAC1B,kBAAC,EAAgB,OAAjB;CAA4B;CAAK,WAAW,EAAG,yBAAyB,CAAS;CAAG,GAAI;AAAQ,CAAA,CACjG;AACD,EAAY,cAAc,EAAgB,MAAM;AAEhD,IAAM,IAAoB,EAAM,YAG7B,EAAE,cAAW,GAAG,KAAS,MAC1B,kBAAC,EAAgB,aAAjB;CACO;CACL,WAAW,EAAG,yCAAyC,CAAS;CAChE,GAAI;AACL,CAAA,CACF;AACD,EAAkB,cAAc,EAAgB,YAAY;;;AC3C5D,IAAM,KAAS,EACb,WACA,cACA,YACA,UACA,gBACA,YACA,YACA,WACA,sBAAmB,IACnB,mBACgB;CAChB,IAAM,UAAoB;EAExB,AADA,EAAU,EAAK,GACf,IAAU;CACZ;CAuBA,OACE,kBAAC,GAAD;EAAQ,MAAM;EAAQ,eAbE,MAAsB;GAC1C,KAAoB,CAAC,MAIpB,KACH,IAAU,GAGZ,EAAU,CAAQ;EACpB;YAII,kBAAC,GAAD;GACE,iBAAiB,KAAoB,MAAU,EAAM,eAAe,IAAI,KAAA;GACxE,mBAAmB,KAAoB,MAAU,EAAM,eAAe,IAAI,KAAA;GAC1E,WAAW,EACT,0HACA,CACF;aANF,CAQE,kBAAC,OAAD;IAAK,WAAU;cAAf;KACG,KAAS,kBAAC,GAAD;MAAa,WAAU;gBAAoD;KAAmB,CAAA;KACvG,KACC,kBAAC,OAAD;MAAK,WAAU;gBACb,kBAAC,GAAD;OAAmB,WAAU;iBAC1B;MACgB,CAAA;KAChB,CAAA;KAEN,KAAW,kBAAC,OAAD;MAAK,WAAU;gBAAmB;KAAa,CAAA;IACxD;QACH,KAAW,MACX,kBAAC,OAAD;IAAK,WAAU;cAAf,CACG,KACC,kBAAC,GAAD;KACE,OAAO,EAAQ;KACf,MAAM,EAAQ;KACd,MAAK;KACL,WAAU;KACV,WAlDe,YAA+B;MAC1D,GAAQ,UAAU;KACpB,EAgDuB,CAAoB,CAAO;IACrC,CAAA,GAEF,KACC,kBAAC,GAAD;KACE,OAAO,EAAO;KACd,MAAM,EAAO;KACb,MAAK;KACL,WAAU;KACV,WAvDc,YAA+B;MAEzD,AADA,GAAQ,UAAU,GAClB,EAAY;KACd,EAoDuB,CAAmB,CAAM;IACnC,CAAA,CAEA;KAEM;;CACT,CAAA;AAEZ"}
|
package/dist/badge.js
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "./TailwindUtil-DiNvXuNl.js";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
import * as r from "react";
|
|
5
|
+
import { cva as i } from "class-variance-authority";
|
|
6
|
+
//#region src/components/badge/Badge.tsx
|
|
7
|
+
var a = i("inline-flex items-center justify-center overflow-hidden", {
|
|
8
|
+
variants: {
|
|
9
|
+
type: {
|
|
10
|
+
filled: "",
|
|
11
|
+
outlined: "",
|
|
12
|
+
tinted: ""
|
|
13
|
+
},
|
|
14
|
+
color: {
|
|
15
|
+
orange: "",
|
|
16
|
+
blue: "",
|
|
17
|
+
red: "",
|
|
18
|
+
green: "",
|
|
19
|
+
neutral: ""
|
|
20
|
+
},
|
|
21
|
+
size: {
|
|
22
|
+
large: "rounded-[4px] h-[28px] px-2 py-1 gap-1",
|
|
23
|
+
small: "rounded-[2px] h-[17px] px-1 py-0.5 gap-1"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
compoundVariants: [
|
|
27
|
+
{
|
|
28
|
+
type: "filled",
|
|
29
|
+
color: "orange",
|
|
30
|
+
className: "bg-surface-base-accent-3-badge"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: "filled",
|
|
34
|
+
color: "blue",
|
|
35
|
+
className: "bg-surface-base-sub-3"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: "filled",
|
|
39
|
+
color: "red",
|
|
40
|
+
className: "bg-surface-base-critical-2"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
type: "filled",
|
|
44
|
+
color: "green",
|
|
45
|
+
className: "bg-surface-base-success-2"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
type: "filled",
|
|
49
|
+
color: "neutral",
|
|
50
|
+
className: "bg-surface-base-neutral-5"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
type: "tinted",
|
|
54
|
+
color: "orange",
|
|
55
|
+
className: "bg-surface-base-accent-1-badge"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
type: "tinted",
|
|
59
|
+
color: "blue",
|
|
60
|
+
className: "bg-surface-base-sub-1"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
type: "tinted",
|
|
64
|
+
color: "red",
|
|
65
|
+
className: "bg-surface-base-critical-1"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: "tinted",
|
|
69
|
+
color: "green",
|
|
70
|
+
className: "bg-surface-base-success-1"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: "tinted",
|
|
74
|
+
color: "neutral",
|
|
75
|
+
className: "bg-surface-base-neutral-2"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
type: "outlined",
|
|
79
|
+
color: "orange",
|
|
80
|
+
className: "border border-border-prominent-accent-badge"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
type: "outlined",
|
|
84
|
+
color: "blue",
|
|
85
|
+
className: "border border-border-prominent-sub"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: "outlined",
|
|
89
|
+
color: "red",
|
|
90
|
+
className: "border border-border-prominent-critical"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
type: "outlined",
|
|
94
|
+
color: "green",
|
|
95
|
+
className: "border border-border-prominent-success"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
type: "outlined",
|
|
99
|
+
color: "neutral",
|
|
100
|
+
className: "border border-border-base-neutral-5"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
defaultVariants: {
|
|
104
|
+
type: "filled",
|
|
105
|
+
color: "neutral",
|
|
106
|
+
size: "large"
|
|
107
|
+
}
|
|
108
|
+
}), o = i("", {
|
|
109
|
+
variants: {
|
|
110
|
+
type: {
|
|
111
|
+
filled: "",
|
|
112
|
+
outlined: "",
|
|
113
|
+
tinted: ""
|
|
114
|
+
},
|
|
115
|
+
color: {
|
|
116
|
+
orange: "",
|
|
117
|
+
blue: "",
|
|
118
|
+
red: "",
|
|
119
|
+
green: "",
|
|
120
|
+
neutral: ""
|
|
121
|
+
},
|
|
122
|
+
size: {
|
|
123
|
+
large: "text-caption-12-medium",
|
|
124
|
+
small: "text-caption-11-medium"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
compoundVariants: [
|
|
128
|
+
{
|
|
129
|
+
type: "filled",
|
|
130
|
+
color: "orange",
|
|
131
|
+
className: "text-text-prominent-neutral-1"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
type: "filled",
|
|
135
|
+
color: "blue",
|
|
136
|
+
className: "text-text-prominent-neutral-1"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
type: "filled",
|
|
140
|
+
color: "red",
|
|
141
|
+
className: "text-text-prominent-neutral-1"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
type: "filled",
|
|
145
|
+
color: "green",
|
|
146
|
+
className: "text-text-prominent-neutral-1"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
type: "filled",
|
|
150
|
+
color: "neutral",
|
|
151
|
+
className: "text-text-prominent-neutral-1"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
type: "tinted",
|
|
155
|
+
color: "orange",
|
|
156
|
+
className: "text-text-prominent-accent-1-badge"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
type: "tinted",
|
|
160
|
+
color: "blue",
|
|
161
|
+
className: "text-text-prominent-sub"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
type: "tinted",
|
|
165
|
+
color: "red",
|
|
166
|
+
className: "text-text-prominent-critical"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
type: "tinted",
|
|
170
|
+
color: "green",
|
|
171
|
+
className: "text-text-prominent-success"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
type: "tinted",
|
|
175
|
+
color: "neutral",
|
|
176
|
+
className: "text-text-base-neutral-3"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
type: "outlined",
|
|
180
|
+
color: "orange",
|
|
181
|
+
className: "text-text-prominent-accent-1-badge"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
type: "outlined",
|
|
185
|
+
color: "blue",
|
|
186
|
+
className: "text-text-prominent-sub"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
type: "outlined",
|
|
190
|
+
color: "red",
|
|
191
|
+
className: "text-text-prominent-critical"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
type: "outlined",
|
|
195
|
+
color: "green",
|
|
196
|
+
className: "text-text-prominent-success"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
type: "outlined",
|
|
200
|
+
color: "neutral",
|
|
201
|
+
className: "text-text-base-neutral-3"
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
defaultVariants: {
|
|
205
|
+
type: "filled",
|
|
206
|
+
color: "neutral",
|
|
207
|
+
size: "large"
|
|
208
|
+
}
|
|
209
|
+
}), s = i("shrink-0", {
|
|
210
|
+
variants: {
|
|
211
|
+
type: {
|
|
212
|
+
filled: "",
|
|
213
|
+
outlined: "",
|
|
214
|
+
tinted: ""
|
|
215
|
+
},
|
|
216
|
+
color: {
|
|
217
|
+
orange: "",
|
|
218
|
+
blue: "",
|
|
219
|
+
red: "",
|
|
220
|
+
green: "",
|
|
221
|
+
neutral: ""
|
|
222
|
+
},
|
|
223
|
+
size: {
|
|
224
|
+
large: "size-[20px]",
|
|
225
|
+
small: "hidden"
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
compoundVariants: [
|
|
229
|
+
{
|
|
230
|
+
type: "filled",
|
|
231
|
+
color: "orange",
|
|
232
|
+
className: "text-icon-base-neutral-1"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
type: "filled",
|
|
236
|
+
color: "blue",
|
|
237
|
+
className: "text-icon-base-neutral-1"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
type: "filled",
|
|
241
|
+
color: "red",
|
|
242
|
+
className: "text-icon-base-neutral-1"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
type: "filled",
|
|
246
|
+
color: "green",
|
|
247
|
+
className: "text-icon-base-neutral-1"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
type: "filled",
|
|
251
|
+
color: "neutral",
|
|
252
|
+
className: "text-icon-base-neutral-1"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
type: "tinted",
|
|
256
|
+
color: "orange",
|
|
257
|
+
className: "text-icon-prominent-accent-1-badge"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
type: "tinted",
|
|
261
|
+
color: "blue",
|
|
262
|
+
className: "text-icon-prominent-sub"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
type: "tinted",
|
|
266
|
+
color: "red",
|
|
267
|
+
className: "text-icon-prominent-critical"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
type: "tinted",
|
|
271
|
+
color: "green",
|
|
272
|
+
className: "text-icon-prominent-success"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
type: "tinted",
|
|
276
|
+
color: "neutral",
|
|
277
|
+
className: "text-icon-base-neutral-3"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
type: "outlined",
|
|
281
|
+
color: "orange",
|
|
282
|
+
className: "text-icon-prominent-accent-1-badge"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
type: "outlined",
|
|
286
|
+
color: "blue",
|
|
287
|
+
className: "text-icon-prominent-sub"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
type: "outlined",
|
|
291
|
+
color: "red",
|
|
292
|
+
className: "text-icon-prominent-critical"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
type: "outlined",
|
|
296
|
+
color: "green",
|
|
297
|
+
className: "text-icon-prominent-success"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
type: "outlined",
|
|
301
|
+
color: "neutral",
|
|
302
|
+
className: "text-icon-base-neutral-3"
|
|
303
|
+
}
|
|
304
|
+
],
|
|
305
|
+
defaultVariants: {
|
|
306
|
+
type: "filled",
|
|
307
|
+
color: "neutral",
|
|
308
|
+
size: "large"
|
|
309
|
+
}
|
|
310
|
+
}), c = r.forwardRef(({ label: r, icon: i, type: c = "filled", color: l = "neutral", size: u = "large", className: d, ...f }, p) => /* @__PURE__ */ n("div", {
|
|
311
|
+
ref: p,
|
|
312
|
+
className: e(a({
|
|
313
|
+
type: c,
|
|
314
|
+
color: l,
|
|
315
|
+
size: u
|
|
316
|
+
}), d),
|
|
317
|
+
...f,
|
|
318
|
+
children: [i && /* @__PURE__ */ t(i, {
|
|
319
|
+
className: s({
|
|
320
|
+
type: c,
|
|
321
|
+
color: l,
|
|
322
|
+
size: u
|
|
323
|
+
}),
|
|
324
|
+
"aria-hidden": !0
|
|
325
|
+
}), /* @__PURE__ */ t("span", {
|
|
326
|
+
className: o({
|
|
327
|
+
type: c,
|
|
328
|
+
color: l,
|
|
329
|
+
size: u
|
|
330
|
+
}),
|
|
331
|
+
children: r
|
|
332
|
+
})]
|
|
333
|
+
}));
|
|
334
|
+
c.displayName = "Badge";
|
|
335
|
+
//#endregion
|
|
336
|
+
export { c as Badge };
|
|
337
|
+
|
|
338
|
+
//# sourceMappingURL=badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.js","names":[],"sources":["../src/components/badge/Badge.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../utils/TailwindUtil\";\n\ntype BadgeType = \"filled\" | \"outlined\" | \"tinted\";\ntype BadgeColor = \"orange\" | \"blue\" | \"red\" | \"green\" | \"neutral\";\ntype BadgeSize = \"small\" | \"large\";\n\nexport interface BadgeProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"children\"> {\n label: string;\n icon?: React.ComponentType<{ className?: string }>;\n type?: BadgeType;\n color?: BadgeColor;\n size?: BadgeSize;\n}\n\nconst badgeVariants = cva(\"inline-flex items-center justify-center overflow-hidden\", {\n variants: {\n type: {\n filled: \"\",\n outlined: \"\",\n tinted: \"\",\n },\n color: {\n orange: \"\",\n blue: \"\",\n red: \"\",\n green: \"\",\n neutral: \"\",\n },\n size: {\n large: \"rounded-[4px] h-[28px] px-2 py-1 gap-1\",\n small: \"rounded-[2px] h-[17px] px-1 py-0.5 gap-1\",\n },\n },\n compoundVariants: [\n {\n type: \"filled\",\n color: \"orange\",\n className: \"bg-surface-base-accent-3-badge\",\n },\n {\n type: \"filled\",\n color: \"blue\",\n className: \"bg-surface-base-sub-3\",\n },\n {\n type: \"filled\",\n color: \"red\",\n className: \"bg-surface-base-critical-2\",\n },\n {\n type: \"filled\",\n color: \"green\",\n className: \"bg-surface-base-success-2\",\n },\n {\n type: \"filled\",\n color: \"neutral\",\n className: \"bg-surface-base-neutral-5\",\n },\n {\n type: \"tinted\",\n color: \"orange\",\n className: \"bg-surface-base-accent-1-badge\",\n },\n {\n type: \"tinted\",\n color: \"blue\",\n className: \"bg-surface-base-sub-1\",\n },\n {\n type: \"tinted\",\n color: \"red\",\n className: \"bg-surface-base-critical-1\",\n },\n {\n type: \"tinted\",\n color: \"green\",\n className: \"bg-surface-base-success-1\",\n },\n {\n type: \"tinted\",\n color: \"neutral\",\n className: \"bg-surface-base-neutral-2\",\n },\n {\n type: \"outlined\",\n color: \"orange\",\n className: \"border border-border-prominent-accent-badge\",\n },\n {\n type: \"outlined\",\n color: \"blue\",\n className: \"border border-border-prominent-sub\",\n },\n {\n type: \"outlined\",\n color: \"red\",\n className: \"border border-border-prominent-critical\",\n },\n {\n type: \"outlined\",\n color: \"green\",\n className: \"border border-border-prominent-success\",\n },\n {\n type: \"outlined\",\n color: \"neutral\",\n className: \"border border-border-base-neutral-5\",\n },\n ],\n defaultVariants: {\n type: \"filled\",\n color: \"neutral\",\n size: \"large\",\n },\n});\n\nconst badgeTextVariants = cva(\"\", {\n variants: {\n type: {\n filled: \"\",\n outlined: \"\",\n tinted: \"\",\n },\n color: {\n orange: \"\",\n blue: \"\",\n red: \"\",\n green: \"\",\n neutral: \"\",\n },\n size: {\n large: \"text-caption-12-medium\",\n small: \"text-caption-11-medium\",\n },\n },\n compoundVariants: [\n {\n type: \"filled\",\n color: \"orange\",\n className: \"text-text-prominent-neutral-1\",\n },\n {\n type: \"filled\",\n color: \"blue\",\n className: \"text-text-prominent-neutral-1\",\n },\n {\n type: \"filled\",\n color: \"red\",\n className: \"text-text-prominent-neutral-1\",\n },\n {\n type: \"filled\",\n color: \"green\",\n className: \"text-text-prominent-neutral-1\",\n },\n {\n type: \"filled\",\n color: \"neutral\",\n className: \"text-text-prominent-neutral-1\",\n },\n {\n type: \"tinted\",\n color: \"orange\",\n className: \"text-text-prominent-accent-1-badge\",\n },\n {\n type: \"tinted\",\n color: \"blue\",\n className: \"text-text-prominent-sub\",\n },\n {\n type: \"tinted\",\n color: \"red\",\n className: \"text-text-prominent-critical\",\n },\n {\n type: \"tinted\",\n color: \"green\",\n className: \"text-text-prominent-success\",\n },\n {\n type: \"tinted\",\n color: \"neutral\",\n className: \"text-text-base-neutral-3\",\n },\n {\n type: \"outlined\",\n color: \"orange\",\n className: \"text-text-prominent-accent-1-badge\",\n },\n {\n type: \"outlined\",\n color: \"blue\",\n className: \"text-text-prominent-sub\",\n },\n {\n type: \"outlined\",\n color: \"red\",\n className: \"text-text-prominent-critical\",\n },\n {\n type: \"outlined\",\n color: \"green\",\n className: \"text-text-prominent-success\",\n },\n {\n type: \"outlined\",\n color: \"neutral\",\n className: \"text-text-base-neutral-3\",\n },\n ],\n defaultVariants: {\n type: \"filled\",\n color: \"neutral\",\n size: \"large\",\n },\n});\n\nconst badgeIconVariants = cva(\"shrink-0\", {\n variants: {\n type: {\n filled: \"\",\n outlined: \"\",\n tinted: \"\",\n },\n color: {\n orange: \"\",\n blue: \"\",\n red: \"\",\n green: \"\",\n neutral: \"\",\n },\n size: {\n large: \"size-[20px]\",\n small: \"hidden\",\n },\n },\n compoundVariants: [\n {\n type: \"filled\",\n color: \"orange\",\n className: \"text-icon-base-neutral-1\",\n },\n {\n type: \"filled\",\n color: \"blue\",\n className: \"text-icon-base-neutral-1\",\n },\n {\n type: \"filled\",\n color: \"red\",\n className: \"text-icon-base-neutral-1\",\n },\n {\n type: \"filled\",\n color: \"green\",\n className: \"text-icon-base-neutral-1\",\n },\n {\n type: \"filled\",\n color: \"neutral\",\n className: \"text-icon-base-neutral-1\",\n },\n {\n type: \"tinted\",\n color: \"orange\",\n className: \"text-icon-prominent-accent-1-badge\",\n },\n {\n type: \"tinted\",\n color: \"blue\",\n className: \"text-icon-prominent-sub\",\n },\n {\n type: \"tinted\",\n color: \"red\",\n className: \"text-icon-prominent-critical\",\n },\n {\n type: \"tinted\",\n color: \"green\",\n className: \"text-icon-prominent-success\",\n },\n {\n type: \"tinted\",\n color: \"neutral\",\n className: \"text-icon-base-neutral-3\",\n },\n {\n type: \"outlined\",\n color: \"orange\",\n className: \"text-icon-prominent-accent-1-badge\",\n },\n {\n type: \"outlined\",\n color: \"blue\",\n className: \"text-icon-prominent-sub\",\n },\n {\n type: \"outlined\",\n color: \"red\",\n className: \"text-icon-prominent-critical\",\n },\n {\n type: \"outlined\",\n color: \"green\",\n className: \"text-icon-prominent-success\",\n },\n {\n type: \"outlined\",\n color: \"neutral\",\n className: \"text-icon-base-neutral-3\",\n },\n ],\n defaultVariants: {\n type: \"filled\",\n color: \"neutral\",\n size: \"large\",\n },\n});\n\nconst Badge = React.forwardRef<HTMLDivElement, BadgeProps>(\n ({ label, icon: Icon, type = \"filled\", color = \"neutral\", size = \"large\", className, ...props }, ref) => {\n return (\n <div ref={ref} className={cn(badgeVariants({ type, color, size }), className)} {...props}>\n {Icon && <Icon className={badgeIconVariants({ type, color, size })} aria-hidden />}\n <span className={badgeTextVariants({ type, color, size })}>{label}</span>\n </div>\n );\n },\n);\n\nBadge.displayName = \"Badge\";\n\nexport { Badge };\n"],"mappings":";;;;;;AAmBA,IAAM,IAAgB,EAAI,2DAA2D;CACnF,UAAU;EACR,MAAM;GACJ,QAAQ;GACR,UAAU;GACV,QAAQ;EACV;EACA,OAAO;GACL,QAAQ;GACR,MAAM;GACN,KAAK;GACL,OAAO;GACP,SAAS;EACX;EACA,MAAM;GACJ,OAAO;GACP,OAAO;EACT;CACF;CACA,kBAAkB;EAChB;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;CACF;CACA,iBAAiB;EACf,MAAM;EACN,OAAO;EACP,MAAM;CACR;AACF,CAAC,GAEK,IAAoB,EAAI,IAAI;CAChC,UAAU;EACR,MAAM;GACJ,QAAQ;GACR,UAAU;GACV,QAAQ;EACV;EACA,OAAO;GACL,QAAQ;GACR,MAAM;GACN,KAAK;GACL,OAAO;GACP,SAAS;EACX;EACA,MAAM;GACJ,OAAO;GACP,OAAO;EACT;CACF;CACA,kBAAkB;EAChB;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;CACF;CACA,iBAAiB;EACf,MAAM;EACN,OAAO;EACP,MAAM;CACR;AACF,CAAC,GAEK,IAAoB,EAAI,YAAY;CACxC,UAAU;EACR,MAAM;GACJ,QAAQ;GACR,UAAU;GACV,QAAQ;EACV;EACA,OAAO;GACL,QAAQ;GACR,MAAM;GACN,KAAK;GACL,OAAO;GACP,SAAS;EACX;EACA,MAAM;GACJ,OAAO;GACP,OAAO;EACT;CACF;CACA,kBAAkB;EAChB;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;EACA;GACE,MAAM;GACN,OAAO;GACP,WAAW;EACb;CACF;CACA,iBAAiB;EACf,MAAM;EACN,OAAO;EACP,MAAM;CACR;AACF,CAAC,GAEK,IAAQ,EAAM,YACjB,EAAE,UAAO,MAAM,GAAM,UAAO,UAAU,WAAQ,WAAW,UAAO,SAAS,cAAW,GAAG,KAAS,MAE7F,kBAAC,OAAD;CAAU;CAAK,WAAW,EAAG,EAAc;EAAE;EAAM;EAAO;CAAK,CAAC,GAAG,CAAS;CAAG,GAAI;WAAnF,CACG,KAAQ,kBAAC,GAAD;EAAM,WAAW,EAAkB;GAAE;GAAM;GAAO;EAAK,CAAC;EAAG,eAAA;CAAa,CAAA,GACjF,kBAAC,QAAD;EAAM,WAAW,EAAkB;GAAE;GAAM;GAAO;EAAK,CAAC;YAAI;CAAY,CAAA,CACrE;EAGX;AAEA,EAAM,cAAc"}
|
package/dist/checkbox.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "./TailwindUtil-DiNvXuNl.js";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/checkbox/Checkbox.tsx
|
|
5
|
+
var r = ({ className: r, id: i, onChange: a, disabled: o, isChecked: s, ...c }) => /* @__PURE__ */ n("label", {
|
|
6
|
+
className: "relative flex h-min w-min cursor-pointer items-center rounded-full has-disabled:cursor-not-allowed",
|
|
7
|
+
htmlFor: i,
|
|
8
|
+
children: [/* @__PURE__ */ t("input", {
|
|
9
|
+
...c,
|
|
10
|
+
type: "checkbox",
|
|
11
|
+
disabled: o,
|
|
12
|
+
className: e("peer bg-petnow-grey-primary checked:bg-surface-primary-accent focus-visible:outline-border-prominent-accent relative size-6 cursor-pointer appearance-none rounded-xl border border-transparent transition-all focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50", r),
|
|
13
|
+
id: i,
|
|
14
|
+
checked: s,
|
|
15
|
+
onChange: (e) => {
|
|
16
|
+
a?.(e.target.checked);
|
|
17
|
+
}
|
|
18
|
+
}), /* @__PURE__ */ t("span", {
|
|
19
|
+
className: "text-petnow-grey-secondary peer-checked:text-icon-prominent-neutral pointer-events-none absolute top-2/4 left-2/4 -translate-x-2/4 -translate-y-2/4 transition peer-disabled:opacity-50",
|
|
20
|
+
children: /* @__PURE__ */ t("svg", {
|
|
21
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
22
|
+
className: "h-4 w-4",
|
|
23
|
+
viewBox: "0 0 20 20",
|
|
24
|
+
fill: "currentColor",
|
|
25
|
+
stroke: "currentColor",
|
|
26
|
+
strokeWidth: "1",
|
|
27
|
+
children: /* @__PURE__ */ t("path", {
|
|
28
|
+
fillRule: "evenodd",
|
|
29
|
+
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
30
|
+
clipRule: "evenodd"
|
|
31
|
+
})
|
|
32
|
+
})
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
//#endregion
|
|
36
|
+
export { r as default };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":[],"sources":["../src/components/checkbox/Checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"../../utils/TailwindUtil\";\n\nimport type { ComponentPropsWithRef } from \"react\";\n\ninterface Props extends Omit<ComponentPropsWithRef<\"input\">, \"type\" | \"checked\" | \"onChange\"> {\n className?: string;\n id?: string;\n onChange?: (newValue: boolean) => void;\n disabled?: boolean;\n /** 제어 컴포넌트로 쓸 때의 체크 상태. 넘기지 않으면 비제어 컴포넌트가 되고, 처음 상태는 `defaultChecked`로 정한다. */\n isChecked?: boolean;\n}\n\nconst Checkbox = ({ className, id, onChange, disabled, isChecked, ...inputProps }: Props) => {\n return (\n <label\n className=\"relative flex h-min w-min cursor-pointer items-center rounded-full has-disabled:cursor-not-allowed\"\n htmlFor={id}\n >\n <input\n {...inputProps}\n type=\"checkbox\"\n disabled={disabled}\n className={cn(\n \"peer bg-petnow-grey-primary checked:bg-surface-primary-accent focus-visible:outline-border-prominent-accent relative size-6 cursor-pointer appearance-none rounded-xl border border-transparent transition-all focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n id={id}\n checked={isChecked}\n onChange={(event) => {\n onChange?.(event.target.checked);\n }}\n />\n <span className=\"text-petnow-grey-secondary peer-checked:text-icon-prominent-neutral pointer-events-none absolute top-2/4 left-2/4 -translate-x-2/4 -translate-y-2/4 transition peer-disabled:opacity-50\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-4 w-4\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"1\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z\"\n clipRule=\"evenodd\"\n ></path>\n </svg>\n </span>\n </label>\n );\n};\n\nexport default Checkbox;\n"],"mappings":";;;;AAeA,IAAM,KAAY,EAAE,cAAW,OAAI,aAAU,aAAU,cAAW,GAAG,QAEjE,kBAAC,SAAD;CACE,WAAU;CACV,SAAS;WAFX,CAIE,kBAAC,SAAD;EACE,GAAI;EACJ,MAAK;EACK;EACV,WAAW,EACT,yTACA,CACF;EACI;EACJ,SAAS;EACT,WAAW,MAAU;GACnB,IAAW,EAAM,OAAO,OAAO;EACjC;CACD,CAAA,GACD,kBAAC,QAAD;EAAM,WAAU;YACd,kBAAC,OAAD;GACE,OAAM;GACN,WAAU;GACV,SAAQ;GACR,MAAK;GACL,QAAO;GACP,aAAY;aAEZ,kBAAC,QAAD;IACE,UAAS;IACT,GAAE;IACF,UAAS;GACJ,CAAA;EACJ,CAAA;CACD,CAAA,CACD"}
|
package/dist/chip.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "./TailwindUtil-DiNvXuNl.js";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
import "react";
|
|
5
|
+
import { cva as r } from "class-variance-authority";
|
|
6
|
+
//#region src/components/chip/Chip.tsx
|
|
7
|
+
var i = r("inline-flex items-center justify-center gap-1 rounded-full border px-[11px] py-[7px] transition-colors duration-200", {
|
|
8
|
+
variants: {
|
|
9
|
+
selected: {
|
|
10
|
+
true: "bg-surface-base-accent-1 border-border-prominent-accent",
|
|
11
|
+
false: "bg-surface-base-neutral-1 border-border-base-neutral-2"
|
|
12
|
+
},
|
|
13
|
+
disabled: {
|
|
14
|
+
true: "opacity-40 pointer-events-none",
|
|
15
|
+
false: ""
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
selected: !1,
|
|
20
|
+
disabled: !1
|
|
21
|
+
}
|
|
22
|
+
}), a = r("text-body-14-medium", {
|
|
23
|
+
variants: { selected: {
|
|
24
|
+
true: "text-text-prominent-accent-1",
|
|
25
|
+
false: "text-text-base-neutral-3"
|
|
26
|
+
} },
|
|
27
|
+
defaultVariants: { selected: !1 }
|
|
28
|
+
}), o = r("size-[18px] shrink-0", {
|
|
29
|
+
variants: { selected: {
|
|
30
|
+
true: "text-icon-prominent-accent-1",
|
|
31
|
+
false: "text-icon-base-neutral-3"
|
|
32
|
+
} },
|
|
33
|
+
defaultVariants: { selected: !1 }
|
|
34
|
+
}), s = ({ className: r, label: s, icon: c, selected: l = !1, disabled: u = !1, onPress: d, onClick: f, type: p = "button", ...m }) => /* @__PURE__ */ n("button", {
|
|
35
|
+
type: p,
|
|
36
|
+
className: e(i({
|
|
37
|
+
selected: l,
|
|
38
|
+
disabled: u
|
|
39
|
+
}), r),
|
|
40
|
+
onClick: (e) => {
|
|
41
|
+
f?.(e), e.defaultPrevented || d?.();
|
|
42
|
+
},
|
|
43
|
+
disabled: u,
|
|
44
|
+
...m,
|
|
45
|
+
children: [c && /* @__PURE__ */ t(c, { className: o({ selected: l }) }), /* @__PURE__ */ t("span", {
|
|
46
|
+
className: a({ selected: l }),
|
|
47
|
+
children: s
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
50
|
+
//#endregion
|
|
51
|
+
export { s as Chip };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=chip.js.map
|
package/dist/chip.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chip.js","names":[],"sources":["../src/components/chip/Chip.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../utils/TailwindUtil\";\n\nexport interface ChipProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, \"children\"> {\n label: string;\n icon?: React.ComponentType<{ className?: string }>;\n selected?: boolean;\n onPress?: () => void;\n}\n\nconst chipVariants = cva(\n \"inline-flex items-center justify-center gap-1 rounded-full border px-[11px] py-[7px] transition-colors duration-200\",\n {\n variants: {\n selected: {\n true: \"bg-surface-base-accent-1 border-border-prominent-accent\",\n false: \"bg-surface-base-neutral-1 border-border-base-neutral-2\",\n },\n disabled: {\n true: \"opacity-40 pointer-events-none\",\n false: \"\",\n },\n },\n defaultVariants: {\n selected: false,\n disabled: false,\n },\n },\n);\n\nconst chipTextVariants = cva(\"text-body-14-medium\", {\n variants: {\n selected: {\n true: \"text-text-prominent-accent-1\",\n false: \"text-text-base-neutral-3\",\n },\n },\n defaultVariants: {\n selected: false,\n },\n});\n\nconst chipIconVariants = cva(\"size-[18px] shrink-0\", {\n variants: {\n selected: {\n true: \"text-icon-prominent-accent-1\",\n false: \"text-icon-base-neutral-3\",\n },\n },\n defaultVariants: {\n selected: false,\n },\n});\n\nconst Chip = ({\n className,\n label,\n icon: Icon,\n selected = false,\n disabled = false,\n onPress,\n onClick,\n type = \"button\",\n ...props\n}: ChipProps) => {\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n\n if (!event.defaultPrevented) {\n onPress?.();\n }\n };\n\n return (\n <button\n type={type}\n className={cn(chipVariants({ selected, disabled }), className)}\n onClick={handleClick}\n disabled={disabled}\n {...props}\n >\n {Icon && <Icon className={chipIconVariants({ selected })} />}\n <span className={chipTextVariants({ selected })}>{label}</span>\n </button>\n );\n};\n\nexport { Chip };\n"],"mappings":";;;;;;AAcA,IAAM,IAAe,EACnB,uHACA;CACE,UAAU;EACR,UAAU;GACR,MAAM;GACN,OAAO;EACT;EACA,UAAU;GACR,MAAM;GACN,OAAO;EACT;CACF;CACA,iBAAiB;EACf,UAAU;EACV,UAAU;CACZ;AACF,CACF,GAEM,IAAmB,EAAI,uBAAuB;CAClD,UAAU,EACR,UAAU;EACR,MAAM;EACN,OAAO;CACT,EACF;CACA,iBAAiB,EACf,UAAU,GACZ;AACF,CAAC,GAEK,IAAmB,EAAI,wBAAwB;CACnD,UAAU,EACR,UAAU;EACR,MAAM;EACN,OAAO;CACT,EACF;CACA,iBAAiB,EACf,UAAU,GACZ;AACF,CAAC,GAEK,KAAQ,EACZ,cACA,UACA,MAAM,GACN,cAAW,IACX,cAAW,IACX,YACA,YACA,UAAO,UACP,GAAG,QAWD,kBAAC,UAAD;CACQ;CACN,WAAW,EAAG,EAAa;EAAE;EAAU;CAAS,CAAC,GAAG,CAAS;CAC7D,UAZiB,MAA+C;EAGlE,AAFA,IAAU,CAAK,GAEV,EAAM,oBACT,IAAU;CAEd;CAOc;CACV,GAAI;WALN,CAOG,KAAQ,kBAAC,GAAD,EAAM,WAAW,EAAiB,EAAE,YAAS,CAAC,EAAI,CAAA,GAC3D,kBAAC,QAAD;EAAM,WAAW,EAAiB,EAAE,YAAS,CAAC;YAAI;CAAY,CAAA,CACxD"}
|