@novi-ui/tactile 0.1.0 → 0.2.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/dist/avatar/avatar.d.mts +1 -1
- package/dist/avatar/avatar.mjs +1 -1
- package/dist/avatar/avatar.mjs.map +1 -1
- package/dist/avatar/avatar.styles.d.mts +3 -3
- package/dist/badge/badge.styles.d.mts +3 -3
- package/dist/button/button.styles.d.mts +3 -3
- package/dist/card/card.styles.d.mts +3 -3
- package/dist/color-picker/color-picker.d.mts +25 -0
- package/dist/color-picker/color-picker.d.mts.map +1 -0
- package/dist/color-picker/color-picker.mjs +109 -0
- package/dist/color-picker/color-picker.mjs.map +1 -0
- package/dist/color-picker/color-picker.styles.d.mts +76 -0
- package/dist/color-picker/color-picker.styles.d.mts.map +1 -0
- package/dist/color-picker/color-picker.styles.mjs +64 -0
- package/dist/color-picker/color-picker.styles.mjs.map +1 -0
- package/dist/color-picker/index.d.mts +3 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.mjs +3 -1
- package/dist/input/input.styles.d.mts +3 -3
- package/dist/menu/menu.styles.d.mts.map +1 -1
- package/dist/menu/menu.styles.mjs +1 -0
- package/dist/menu/menu.styles.mjs.map +1 -1
- package/dist/modal/modal.styles.d.mts +3 -3
- package/dist/modal/modal.styles.d.mts.map +1 -1
- package/dist/modal/modal.styles.mjs +1 -0
- package/dist/modal/modal.styles.mjs.map +1 -1
- package/dist/popover/popover.styles.d.mts +3 -3
- package/dist/select/select.styles.d.mts +3 -3
- package/dist/select/select.styles.d.mts.map +1 -1
- package/dist/select/select.styles.mjs +1 -0
- package/dist/select/select.styles.mjs.map +1 -1
- package/dist/skeleton/skeleton.styles.d.mts +3 -3
- package/dist/tactile.css +49 -1
- package/dist/tactile.scoped.css +49 -1
- package/dist/textarea/textarea.styles.d.mts +3 -3
- package/dist/toast/toast.styles.d.mts +3 -3
- package/dist/toast/toast.styles.d.mts.map +1 -1
- package/dist/toast/toast.styles.mjs +6 -1
- package/dist/toast/toast.styles.mjs.map +1 -1
- package/dist/tokens/color-set.mjs +111 -0
- package/dist/tokens/color-set.mjs.map +1 -0
- package/package.json +3 -3
package/dist/avatar/avatar.d.mts
CHANGED
|
@@ -11,7 +11,7 @@ declare function initialsOf(name: string): string;
|
|
|
11
11
|
* 人や組織を表す画像。読み込みに失敗したら fallback を表示する。
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
|
-
* <Avatar src="/me.jpg" name="
|
|
14
|
+
* <Avatar src="/me.jpg" name="山本 太郎" />
|
|
15
15
|
*/
|
|
16
16
|
declare function Avatar({ size, radius, src, name, fallback, badge, className, classNames, id }: AvatarProps): import("react").JSX.Element;
|
|
17
17
|
//#endregion
|
package/dist/avatar/avatar.mjs
CHANGED
|
@@ -19,7 +19,7 @@ function initialsOf(name) {
|
|
|
19
19
|
* 人や組織を表す画像。読み込みに失敗したら fallback を表示する。
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
|
-
* <Avatar src="/me.jpg" name="
|
|
22
|
+
* <Avatar src="/me.jpg" name="山本 太郎" />
|
|
23
23
|
*/
|
|
24
24
|
function Avatar({ size, radius, src, name, fallback, badge, className, classNames, id }) {
|
|
25
25
|
const s = avatarStyles({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.mjs","names":[],"sources":["../../src/avatar/avatar.tsx"],"sourcesContent":["'use client'\n\nimport type { AvatarProps } from '@novi-ui/core'\nimport { useState } from 'react'\nimport { avatarStyles } from './avatar.styles'\n\n/**\n * 表示名からイニシャルを作る。\n *\n * 日本語の氏名は空白で区切られないことが多いので、\n * 空白があれば各語の先頭、なければ先頭1文字を使う。\n */\nexport function initialsOf(name: string): string {\n const parts = name.trim().split(/\\s+/).filter(Boolean)\n if (parts.length === 0) return ''\n if (parts.length === 1) return [...(parts[0] as string)][0] ?? ''\n return parts\n .slice(0, 2)\n .map((part) => [...part][0] ?? '')\n .join('')\n}\n\n/**\n * 人や組織を表す画像。読み込みに失敗したら fallback を表示する。\n *\n * @example\n * <Avatar src=\"/me.jpg\" name=\"
|
|
1
|
+
{"version":3,"file":"avatar.mjs","names":[],"sources":["../../src/avatar/avatar.tsx"],"sourcesContent":["'use client'\n\nimport type { AvatarProps } from '@novi-ui/core'\nimport { useState } from 'react'\nimport { avatarStyles } from './avatar.styles'\n\n/**\n * 表示名からイニシャルを作る。\n *\n * 日本語の氏名は空白で区切られないことが多いので、\n * 空白があれば各語の先頭、なければ先頭1文字を使う。\n */\nexport function initialsOf(name: string): string {\n const parts = name.trim().split(/\\s+/).filter(Boolean)\n if (parts.length === 0) return ''\n if (parts.length === 1) return [...(parts[0] as string)][0] ?? ''\n return parts\n .slice(0, 2)\n .map((part) => [...part][0] ?? '')\n .join('')\n}\n\n/**\n * 人や組織を表す画像。読み込みに失敗したら fallback を表示する。\n *\n * @example\n * <Avatar src=\"/me.jpg\" name=\"山本 太郎\" />\n */\nexport function Avatar({\n size,\n radius,\n src,\n name,\n fallback,\n badge,\n className,\n classNames,\n id,\n}: AvatarProps) {\n const s = avatarStyles({ size, radius })\n const [failed, setFailed] = useState(false)\n const showImage = src !== undefined && src !== '' && !failed\n\n return (\n <span id={id} data-slot=\"root\" className={s.root({ class: [className, classNames?.root] })}>\n {showImage ? (\n <img\n data-slot=\"image\"\n className={s.image({ class: classNames?.image })}\n src={src}\n alt={name ?? ''}\n onError={() => setFailed(true)}\n />\n ) : (\n // 画像の代わりなので role=\"img\" を与える。\n // これがないと aria-label が効かず、読み上げが「山太」のような\n // イニシャルだけになって氏名が伝わらない\n <span\n data-slot=\"fallback\"\n className={s.fallback({ class: classNames?.fallback })}\n role=\"img\"\n aria-label={name}\n >\n {fallback ?? (name !== undefined ? initialsOf(name) : null)}\n </span>\n )}\n\n {badge !== undefined && (\n <span data-slot=\"badge\" className={s.badge({ class: classNames?.badge })}>\n {badge}\n </span>\n )}\n </span>\n )\n}\n"],"mappings":";;;;;;;;;;;AAYA,SAAgB,WAAW,MAAsB;CAC/C,MAAM,QAAQ,KAAK,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO;CACrD,IAAI,MAAM,WAAW,GAAG,OAAO;CAC/B,IAAI,MAAM,WAAW,GAAG,OAAO,CAAC,GAAI,MAAM,EAAa,CAAC,CAAC,MAAM;CAC/D,OAAO,MACJ,MAAM,GAAG,CAAC,CAAC,CACX,KAAK,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,CACjC,KAAK,EAAE;AACZ;;;;;;;AAQA,SAAgB,OAAO,EACrB,MACA,QACA,KACA,MACA,UACA,OACA,WACA,YACA,MACc;CACd,MAAM,IAAI,aAAa;EAAE;EAAM;CAAO,CAAC;CACvC,MAAM,CAAC,QAAQ,aAAa,SAAS,KAAK;CAC1C,MAAM,YAAY,QAAQ,KAAA,KAAa,QAAQ,MAAM,CAAC;CAEtD,OACE,qBAAC,QAAD;EAAU;EAAI,aAAU;EAAO,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,WAAW,YAAY,IAAI,EAAE,CAAC;EAAzF,UAAA,CACG,YACC,oBAAC,OAAD;GACE,aAAU;GACV,WAAW,EAAE,MAAM,EAAE,OAAO,YAAY,MAAM,CAAC;GAC1C;GACL,KAAK,QAAQ;GACb,eAAe,UAAU,IAAI;EAC9B,CAAA,IAKD,oBAAC,QAAD;GACE,aAAU;GACV,WAAW,EAAE,SAAS,EAAE,OAAO,YAAY,SAAS,CAAC;GACrD,MAAK;GACL,cAAY;GAEX,UAAA,aAAa,SAAS,KAAA,IAAY,WAAW,IAAI,IAAI;EAClD,CAAA,GAGP,UAAU,KAAA,KACT,oBAAC,QAAD;GAAM,aAAU;GAAQ,WAAW,EAAE,MAAM,EAAE,OAAO,YAAY,MAAM,CAAC;GACpE,UAAA;EACG,CAAA,CAEJ;;AAEV"}
|
|
@@ -10,7 +10,7 @@ declare const avatarStyles: import("tailwind-variants").TVReturnType<{
|
|
|
10
10
|
size: VariantMap<"sm" | "md" | "lg", {
|
|
11
11
|
root: string;
|
|
12
12
|
}>;
|
|
13
|
-
radius: VariantMap<"
|
|
13
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
14
14
|
root: string;
|
|
15
15
|
}>;
|
|
16
16
|
}, {
|
|
@@ -22,7 +22,7 @@ declare const avatarStyles: import("tailwind-variants").TVReturnType<{
|
|
|
22
22
|
size: VariantMap<"sm" | "md" | "lg", {
|
|
23
23
|
root: string;
|
|
24
24
|
}>;
|
|
25
|
-
radius: VariantMap<"
|
|
25
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
26
26
|
root: string;
|
|
27
27
|
}>;
|
|
28
28
|
}, {
|
|
@@ -34,7 +34,7 @@ declare const avatarStyles: import("tailwind-variants").TVReturnType<{
|
|
|
34
34
|
size: VariantMap<"sm" | "md" | "lg", {
|
|
35
35
|
root: string;
|
|
36
36
|
}>;
|
|
37
|
-
radius: VariantMap<"
|
|
37
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
38
38
|
root: string;
|
|
39
39
|
}>;
|
|
40
40
|
}, {
|
|
@@ -14,7 +14,7 @@ declare const badgeStyles: import("tailwind-variants").TVReturnType<{
|
|
|
14
14
|
root: string;
|
|
15
15
|
dot: string;
|
|
16
16
|
}>;
|
|
17
|
-
radius: VariantMap<"
|
|
17
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
18
18
|
root: string;
|
|
19
19
|
}>;
|
|
20
20
|
variant: VariantMap<"solid" | "outline" | "soft" | "ghost" | "plain", {
|
|
@@ -32,7 +32,7 @@ declare const badgeStyles: import("tailwind-variants").TVReturnType<{
|
|
|
32
32
|
root: string;
|
|
33
33
|
dot: string;
|
|
34
34
|
}>;
|
|
35
|
-
radius: VariantMap<"
|
|
35
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
36
36
|
root: string;
|
|
37
37
|
}>;
|
|
38
38
|
variant: VariantMap<"solid" | "outline" | "soft" | "ghost" | "plain", {
|
|
@@ -50,7 +50,7 @@ declare const badgeStyles: import("tailwind-variants").TVReturnType<{
|
|
|
50
50
|
root: string;
|
|
51
51
|
dot: string;
|
|
52
52
|
}>;
|
|
53
|
-
radius: VariantMap<"
|
|
53
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
54
54
|
root: string;
|
|
55
55
|
}>;
|
|
56
56
|
variant: VariantMap<"solid" | "outline" | "soft" | "ghost" | "plain", {
|
|
@@ -25,7 +25,7 @@ declare const buttonStyles: import("tailwind-variants").TVReturnType<{
|
|
|
25
25
|
size: VariantMap<"sm" | "md" | "lg", {
|
|
26
26
|
root: string;
|
|
27
27
|
}>;
|
|
28
|
-
radius: VariantMap<"
|
|
28
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
29
29
|
root: string;
|
|
30
30
|
}>;
|
|
31
31
|
variant: VariantMap<"solid" | "outline" | "soft" | "ghost" | "plain", {
|
|
@@ -44,7 +44,7 @@ declare const buttonStyles: import("tailwind-variants").TVReturnType<{
|
|
|
44
44
|
size: VariantMap<"sm" | "md" | "lg", {
|
|
45
45
|
root: string;
|
|
46
46
|
}>;
|
|
47
|
-
radius: VariantMap<"
|
|
47
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
48
48
|
root: string;
|
|
49
49
|
}>;
|
|
50
50
|
variant: VariantMap<"solid" | "outline" | "soft" | "ghost" | "plain", {
|
|
@@ -63,7 +63,7 @@ declare const buttonStyles: import("tailwind-variants").TVReturnType<{
|
|
|
63
63
|
size: VariantMap<"sm" | "md" | "lg", {
|
|
64
64
|
root: string;
|
|
65
65
|
}>;
|
|
66
|
-
radius: VariantMap<"
|
|
66
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
67
67
|
root: string;
|
|
68
68
|
}>;
|
|
69
69
|
variant: VariantMap<"solid" | "outline" | "soft" | "ghost" | "plain", {
|
|
@@ -10,7 +10,7 @@ declare const cardStyles: import("tailwind-variants").TVReturnType<{
|
|
|
10
10
|
variant: VariantMap<"solid" | "outline" | "soft" | "ghost" | "plain", {
|
|
11
11
|
root: string;
|
|
12
12
|
}>;
|
|
13
|
-
radius: VariantMap<"
|
|
13
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
14
14
|
root: string;
|
|
15
15
|
}>;
|
|
16
16
|
isPressable: {
|
|
@@ -29,7 +29,7 @@ declare const cardStyles: import("tailwind-variants").TVReturnType<{
|
|
|
29
29
|
variant: VariantMap<"solid" | "outline" | "soft" | "ghost" | "plain", {
|
|
30
30
|
root: string;
|
|
31
31
|
}>;
|
|
32
|
-
radius: VariantMap<"
|
|
32
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
33
33
|
root: string;
|
|
34
34
|
}>;
|
|
35
35
|
isPressable: {
|
|
@@ -48,7 +48,7 @@ declare const cardStyles: import("tailwind-variants").TVReturnType<{
|
|
|
48
48
|
variant: VariantMap<"solid" | "outline" | "soft" | "ghost" | "plain", {
|
|
49
49
|
root: string;
|
|
50
50
|
}>;
|
|
51
|
-
radius: VariantMap<"
|
|
51
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
52
52
|
root: string;
|
|
53
53
|
}>;
|
|
54
54
|
isPressable: {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ColorPickerProps, NoviColorOption } from "@novi-ui/core";
|
|
2
|
+
//#region src/color-picker/color-picker.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Tactile のカラーセット(Textile Dyes)。**利用側が色値を書かなくてよい**ように既定で並ぶ。
|
|
5
|
+
*
|
|
6
|
+
* ここが `colors` prop の既定値になる。同じ `<ColorPicker />` でも
|
|
7
|
+
* Raster では Print Inks が出る。色はモデルの持ち物で、共通ではない。
|
|
8
|
+
*/
|
|
9
|
+
declare const COLOR_OPTIONS: readonly NoviColorOption[];
|
|
10
|
+
/**
|
|
11
|
+
* テーマのカラーセットから1色を選ぶ。選んだ値を `data-novi-color` に渡すと配色が変わる。
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // 色 id を書かない。未指定ならテーマの既定色から始まる
|
|
15
|
+
* const [color, setColor] = useState<string>()
|
|
16
|
+
* return (
|
|
17
|
+
* <div data-novi-color={color}>
|
|
18
|
+
* <ColorPicker label="配色" onChange={setColor} />
|
|
19
|
+
* </div>
|
|
20
|
+
* )
|
|
21
|
+
*/
|
|
22
|
+
declare function ColorPicker({ size, label, description, errorMessage, value, defaultValue, onChange, colors, showLabels, isDisabled, isReadOnly, isRequired, isInvalid, name, className, classNames, id }: ColorPickerProps): import("react").JSX.Element;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { COLOR_OPTIONS, ColorPicker };
|
|
25
|
+
//# sourceMappingURL=color-picker.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-picker.d.mts","names":[],"sources":["../../src/color-picker/color-picker.tsx"],"mappings":";;;;;;;;cAmBa,wBAAwB;;;;;;;;;;;;;iBAyBrB,cACd,MACA,OACA,aACA,cACA,OACA,cACA,UACA,QACA,YACA,YACA,YACA,YACA,WACA,MACA,WACA,YACA,MACC,mCAAgB,IAAA"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { DEFAULT_COLOR_ID, TACTILE_COLOR_SET } from "../tokens/color-set.mjs";
|
|
3
|
+
import { colorPickerStyles } from "./color-picker.styles.mjs";
|
|
4
|
+
import { FieldError, Label, Radio, RadioGroup, Text } from "react-aria-components";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/color-picker/color-picker.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Tactile のカラーセット(Textile Dyes)。**利用側が色値を書かなくてよい**ように既定で並ぶ。
|
|
9
|
+
*
|
|
10
|
+
* ここが `colors` prop の既定値になる。同じ `<ColorPicker />` でも
|
|
11
|
+
* Raster では Print Inks が出る。色はモデルの持ち物で、共通ではない。
|
|
12
|
+
*/
|
|
13
|
+
const COLOR_OPTIONS = TACTILE_COLOR_SET.map(({ id, name, description }) => ({
|
|
14
|
+
id,
|
|
15
|
+
name,
|
|
16
|
+
description
|
|
17
|
+
}));
|
|
18
|
+
/** 選択中であることを色以外でも示す印。 */
|
|
19
|
+
function CheckMark() {
|
|
20
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
21
|
+
viewBox: "0 0 16 16",
|
|
22
|
+
width: "0.75em",
|
|
23
|
+
height: "0.75em",
|
|
24
|
+
fill: "none",
|
|
25
|
+
"aria-hidden": "true",
|
|
26
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
27
|
+
d: "M2.5 8.5l3.5 3.5 7.5-8",
|
|
28
|
+
stroke: "currentColor",
|
|
29
|
+
strokeWidth: "2"
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* テーマのカラーセットから1色を選ぶ。選んだ値を `data-novi-color` に渡すと配色が変わる。
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* // 色 id を書かない。未指定ならテーマの既定色から始まる
|
|
38
|
+
* const [color, setColor] = useState<string>()
|
|
39
|
+
* return (
|
|
40
|
+
* <div data-novi-color={color}>
|
|
41
|
+
* <ColorPicker label="配色" onChange={setColor} />
|
|
42
|
+
* </div>
|
|
43
|
+
* )
|
|
44
|
+
*/
|
|
45
|
+
function ColorPicker({ size, label, description, errorMessage, value, defaultValue = DEFAULT_COLOR_ID, onChange, colors = COLOR_OPTIONS, showLabels = false, isDisabled, isReadOnly, isRequired, isInvalid, name, className, classNames, id }) {
|
|
46
|
+
const s = colorPickerStyles({ size });
|
|
47
|
+
return /* @__PURE__ */ jsxs(RadioGroup, {
|
|
48
|
+
id,
|
|
49
|
+
name,
|
|
50
|
+
value,
|
|
51
|
+
defaultValue,
|
|
52
|
+
onChange,
|
|
53
|
+
isDisabled,
|
|
54
|
+
isReadOnly,
|
|
55
|
+
isRequired,
|
|
56
|
+
isInvalid,
|
|
57
|
+
"data-slot": "root",
|
|
58
|
+
className: s.root({ class: [className, classNames?.root] }),
|
|
59
|
+
children: [
|
|
60
|
+
label !== void 0 && /* @__PURE__ */ jsx(Label, {
|
|
61
|
+
"data-slot": "label",
|
|
62
|
+
className: s.label({ class: classNames?.label }),
|
|
63
|
+
children: label
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ jsx("div", {
|
|
66
|
+
"data-slot": "list",
|
|
67
|
+
className: s.list({ class: classNames?.list }),
|
|
68
|
+
children: colors.map((color) => /* @__PURE__ */ jsx(Radio, {
|
|
69
|
+
value: color.id,
|
|
70
|
+
"aria-label": color.name,
|
|
71
|
+
"data-slot": "item",
|
|
72
|
+
className: `group ${s.item({ class: classNames?.item })}`,
|
|
73
|
+
children: ({ isSelected }) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
74
|
+
"data-slot": "swatch",
|
|
75
|
+
style: {
|
|
76
|
+
background: `var(--novi-swatch-${color.id})`,
|
|
77
|
+
color: `var(--novi-swatch-${color.id}-fg)`
|
|
78
|
+
},
|
|
79
|
+
className: s.swatch({ class: classNames?.swatch }),
|
|
80
|
+
children: isSelected && /* @__PURE__ */ jsx("span", {
|
|
81
|
+
"data-slot": "indicator",
|
|
82
|
+
className: s.indicator({ class: classNames?.indicator }),
|
|
83
|
+
children: /* @__PURE__ */ jsx(CheckMark, {})
|
|
84
|
+
})
|
|
85
|
+
}), showLabels && /* @__PURE__ */ jsx("span", {
|
|
86
|
+
"data-slot": "itemLabel",
|
|
87
|
+
className: s.itemLabel({ class: classNames?.itemLabel }),
|
|
88
|
+
children: color.name
|
|
89
|
+
})] })
|
|
90
|
+
}, color.id))
|
|
91
|
+
}),
|
|
92
|
+
description !== void 0 && /* @__PURE__ */ jsx(Text, {
|
|
93
|
+
slot: "description",
|
|
94
|
+
"data-slot": "description",
|
|
95
|
+
className: s.description({ class: classNames?.description }),
|
|
96
|
+
children: description
|
|
97
|
+
}),
|
|
98
|
+
errorMessage !== void 0 && /* @__PURE__ */ jsx(FieldError, {
|
|
99
|
+
"data-slot": "errorMessage",
|
|
100
|
+
className: s.errorMessage({ class: classNames?.errorMessage }),
|
|
101
|
+
children: errorMessage
|
|
102
|
+
})
|
|
103
|
+
]
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
107
|
+
export { COLOR_OPTIONS, ColorPicker };
|
|
108
|
+
|
|
109
|
+
//# sourceMappingURL=color-picker.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-picker.mjs","names":["RACRadioGroup","RACRadio"],"sources":["../../src/color-picker/color-picker.tsx"],"sourcesContent":["'use client'\n\nimport type { ColorPickerProps, NoviColorOption } from '@novi-ui/core'\nimport {\n FieldError,\n Label,\n Radio as RACRadio,\n RadioGroup as RACRadioGroup,\n Text,\n} from 'react-aria-components'\nimport { DEFAULT_COLOR_ID, TACTILE_COLOR_SET } from '../tokens/color-set'\nimport { colorPickerStyles } from './color-picker.styles'\n\n/**\n * Tactile のカラーセット(Textile Dyes)。**利用側が色値を書かなくてよい**ように既定で並ぶ。\n *\n * ここが `colors` prop の既定値になる。同じ `<ColorPicker />` でも\n * Raster では Print Inks が出る。色はモデルの持ち物で、共通ではない。\n */\nexport const COLOR_OPTIONS: readonly NoviColorOption[] = TACTILE_COLOR_SET.map(\n ({ id, name, description }) => ({ id, name, description }),\n)\n\n/** 選択中であることを色以外でも示す印。 */\nfunction CheckMark() {\n return (\n <svg viewBox=\"0 0 16 16\" width=\"0.75em\" height=\"0.75em\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"M2.5 8.5l3.5 3.5 7.5-8\" stroke=\"currentColor\" strokeWidth=\"2\" />\n </svg>\n )\n}\n\n/**\n * テーマのカラーセットから1色を選ぶ。選んだ値を `data-novi-color` に渡すと配色が変わる。\n *\n * @example\n * // 色 id を書かない。未指定ならテーマの既定色から始まる\n * const [color, setColor] = useState<string>()\n * return (\n * <div data-novi-color={color}>\n * <ColorPicker label=\"配色\" onChange={setColor} />\n * </div>\n * )\n */\nexport function ColorPicker({\n size,\n label,\n description,\n errorMessage,\n value,\n defaultValue = DEFAULT_COLOR_ID,\n onChange,\n colors = COLOR_OPTIONS,\n showLabels = false,\n isDisabled,\n isReadOnly,\n isRequired,\n isInvalid,\n name,\n className,\n classNames,\n id,\n}: ColorPickerProps) {\n const s = colorPickerStyles({ size })\n\n return (\n <RACRadioGroup\n id={id}\n name={name}\n value={value}\n defaultValue={defaultValue}\n onChange={onChange}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired}\n isInvalid={isInvalid}\n data-slot=\"root\"\n className={s.root({ class: [className, classNames?.root] })}\n >\n {label !== undefined && (\n <Label data-slot=\"label\" className={s.label({ class: classNames?.label })}>\n {label}\n </Label>\n )}\n\n <div data-slot=\"list\" className={s.list({ class: classNames?.list })}>\n {colors.map((color) => (\n <RACRadio\n key={color.id}\n value={color.id}\n // スウォッチは色の面でしかない。名前を持たせないと読み上げが「ラジオボタン」で終わる\n aria-label={color.name}\n data-slot=\"item\"\n className={`group ${s.item({ class: classNames?.item })}`}\n >\n {({ isSelected }) => (\n <>\n {/*\n 色の解決は生成 CSS の `--novi-swatch-*` に委ねる。実装は色値を持たない。\n `data-novi-color` を置く形は採れない — テーマ宣言ごと切り替わってしまい、\n ライト / ダークの選択からも外れる(06 の申し送り)。\n */}\n <span\n data-slot=\"swatch\"\n style={{\n background: `var(--novi-swatch-${color.id})`,\n color: `var(--novi-swatch-${color.id}-fg)`,\n }}\n className={s.swatch({ class: classNames?.swatch })}\n >\n {isSelected && (\n <span\n data-slot=\"indicator\"\n className={s.indicator({ class: classNames?.indicator })}\n >\n <CheckMark />\n </span>\n )}\n </span>\n\n {showLabels && (\n <span\n data-slot=\"itemLabel\"\n className={s.itemLabel({ class: classNames?.itemLabel })}\n >\n {color.name}\n </span>\n )}\n </>\n )}\n </RACRadio>\n ))}\n </div>\n\n {description !== undefined && (\n <Text\n slot=\"description\"\n data-slot=\"description\"\n className={s.description({ class: classNames?.description })}\n >\n {description}\n </Text>\n )}\n\n {errorMessage !== undefined && (\n <FieldError\n data-slot=\"errorMessage\"\n className={s.errorMessage({ class: classNames?.errorMessage })}\n >\n {errorMessage}\n </FieldError>\n )}\n </RACRadioGroup>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAmBA,MAAa,gBAA4C,kBAAkB,KACxE,EAAE,IAAI,MAAM,mBAAmB;CAAE;CAAI;CAAM;AAAY,EAC1D;;AAGA,SAAS,YAAY;CACnB,OACE,oBAAC,OAAD;EAAK,SAAQ;EAAY,OAAM;EAAS,QAAO;EAAS,MAAK;EAAO,eAAY;EAC9E,UAAA,oBAAC,QAAD;GAAM,GAAE;GAAyB,QAAO;GAAe,aAAY;EAAK,CAAA;CACrE,CAAA;AAET;;;;;;;;;;;;;AAcA,SAAgB,YAAY,EAC1B,MACA,OACA,aACA,cACA,OACA,eAAe,kBACf,UACA,SAAS,eACT,aAAa,OACb,YACA,YACA,YACA,WACA,MACA,WACA,YACA,MACmB;CACnB,MAAM,IAAI,kBAAkB,EAAE,KAAK,CAAC;CAEpC,OACE,qBAACA,YAAD;EACM;EACE;EACC;EACO;EACJ;EACE;EACA;EACA;EACD;EACX,aAAU;EACV,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,WAAW,YAAY,IAAI,EAAE,CAAC;EAX5D,UAAA;GAaG,UAAU,KAAA,KACT,oBAAC,OAAD;IAAO,aAAU;IAAQ,WAAW,EAAE,MAAM,EAAE,OAAO,YAAY,MAAM,CAAC;IACrE,UAAA;GACI,CAAA;GAGT,oBAAC,OAAD;IAAK,aAAU;IAAO,WAAW,EAAE,KAAK,EAAE,OAAO,YAAY,KAAK,CAAC;IAChE,UAAA,OAAO,KAAK,UACX,oBAACC,OAAD;KAEE,OAAO,MAAM;KAEb,cAAY,MAAM;KAClB,aAAU;KACV,WAAW,SAAS,EAAE,KAAK,EAAE,OAAO,YAAY,KAAK,CAAC;KAEpD,WAAA,EAAE,iBACF,qBAAA,UAAA,EAAA,UAAA,CAME,oBAAC,QAAD;MACE,aAAU;MACV,OAAO;OACL,YAAY,qBAAqB,MAAM,GAAG;OAC1C,OAAO,qBAAqB,MAAM,GAAG;MACvC;MACA,WAAW,EAAE,OAAO,EAAE,OAAO,YAAY,OAAO,CAAC;MAEhD,UAAA,cACC,oBAAC,QAAD;OACE,aAAU;OACV,WAAW,EAAE,UAAU,EAAE,OAAO,YAAY,UAAU,CAAC;OAEvD,UAAA,oBAAC,WAAD,CAAY,CAAA;MACR,CAAA;KAEJ,CAAA,GAEL,cACC,oBAAC,QAAD;MACE,aAAU;MACV,WAAW,EAAE,UAAU,EAAE,OAAO,YAAY,UAAU,CAAC;MAEtD,UAAA,MAAM;KACH,CAAA,CAER,EAAA,CAAA;IAEI,GA1CH,MAAM,EA0CH,CACX;GACE,CAAA;GAEJ,gBAAgB,KAAA,KACf,oBAAC,MAAD;IACE,MAAK;IACL,aAAU;IACV,WAAW,EAAE,YAAY,EAAE,OAAO,YAAY,YAAY,CAAC;IAE1D,UAAA;GACG,CAAA;GAGP,iBAAiB,KAAA,KAChB,oBAAC,YAAD;IACE,aAAU;IACV,WAAW,EAAE,aAAa,EAAE,OAAO,YAAY,aAAa,CAAC;IAE5D,UAAA;GACS,CAAA;EAED;;AAEnB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { VariantMap } from "@novi-ui/core";
|
|
2
|
+
//#region src/color-picker/color-picker.styles.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* ColorPicker のスタイル定義。
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* import { colorPickerStyles } from '@novi-ui/tactile'
|
|
8
|
+
* import { tv } from 'tailwind-variants'
|
|
9
|
+
*
|
|
10
|
+
* const myPicker = tv({ extend: colorPickerStyles, slots: { list: 'gap-4' } })
|
|
11
|
+
*/
|
|
12
|
+
declare const colorPickerStyles: import("tailwind-variants").TVReturnType<{
|
|
13
|
+
size: VariantMap<"sm" | "md" | "lg", {
|
|
14
|
+
swatch: string;
|
|
15
|
+
}>;
|
|
16
|
+
}, {
|
|
17
|
+
root: string;
|
|
18
|
+
label: string;
|
|
19
|
+
description: string;
|
|
20
|
+
errorMessage: string;
|
|
21
|
+
list: string;
|
|
22
|
+
item: string;
|
|
23
|
+
/**
|
|
24
|
+
* 色そのものを見せる面。
|
|
25
|
+
*
|
|
26
|
+
* **色は生成 CSS の `--novi-swatch-*` が解決する。** 実装が色値を持たないので、
|
|
27
|
+
* 染料が増えてもここは変わらず、light / dark の追従も生成 CSS 任せになる。
|
|
28
|
+
*/
|
|
29
|
+
swatch: string;
|
|
30
|
+
indicator: string;
|
|
31
|
+
itemLabel: string;
|
|
32
|
+
}, undefined, {
|
|
33
|
+
size: VariantMap<"sm" | "md" | "lg", {
|
|
34
|
+
swatch: string;
|
|
35
|
+
}>;
|
|
36
|
+
}, {
|
|
37
|
+
root: string;
|
|
38
|
+
label: string;
|
|
39
|
+
description: string;
|
|
40
|
+
errorMessage: string;
|
|
41
|
+
list: string;
|
|
42
|
+
item: string;
|
|
43
|
+
/**
|
|
44
|
+
* 色そのものを見せる面。
|
|
45
|
+
*
|
|
46
|
+
* **色は生成 CSS の `--novi-swatch-*` が解決する。** 実装が色値を持たないので、
|
|
47
|
+
* 染料が増えてもここは変わらず、light / dark の追従も生成 CSS 任せになる。
|
|
48
|
+
*/
|
|
49
|
+
swatch: string;
|
|
50
|
+
indicator: string;
|
|
51
|
+
itemLabel: string;
|
|
52
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
53
|
+
size: VariantMap<"sm" | "md" | "lg", {
|
|
54
|
+
swatch: string;
|
|
55
|
+
}>;
|
|
56
|
+
}, {
|
|
57
|
+
root: string;
|
|
58
|
+
label: string;
|
|
59
|
+
description: string;
|
|
60
|
+
errorMessage: string;
|
|
61
|
+
list: string;
|
|
62
|
+
item: string;
|
|
63
|
+
/**
|
|
64
|
+
* 色そのものを見せる面。
|
|
65
|
+
*
|
|
66
|
+
* **色は生成 CSS の `--novi-swatch-*` が解決する。** 実装が色値を持たないので、
|
|
67
|
+
* 染料が増えてもここは変わらず、light / dark の追従も生成 CSS 任せになる。
|
|
68
|
+
*/
|
|
69
|
+
swatch: string;
|
|
70
|
+
indicator: string;
|
|
71
|
+
itemLabel: string;
|
|
72
|
+
}>>;
|
|
73
|
+
type ColorPickerStyleProps = Parameters<typeof colorPickerStyles>[0];
|
|
74
|
+
//#endregion
|
|
75
|
+
export { ColorPickerStyleProps, colorPickerStyles };
|
|
76
|
+
//# sourceMappingURL=color-picker.styles.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-picker.styles.d.mts","names":[],"sources":["../../src/color-picker/color-picker.styles.ts"],"mappings":";;;;;;;;;;;cA0Ea,+CAAiB;;IAfa;;;;;;;;;;;;;;;;;;;;IAAA;;;;;;;;;;;;;;;;;;;;IAAA;;;;;;;;;;;;;;;;;;;KAqB/B,wBAAwB,kBAAkB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { disabledState, focusRing } from "../styles/focus-ring.mjs";
|
|
2
|
+
import { tapTarget } from "../styles/tap-target.mjs";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
//#region src/color-picker/color-picker.styles.ts
|
|
5
|
+
/**
|
|
6
|
+
* Tactile のカラー選択は**染料の玉**。丸く、指で押せる大きさで並べる。
|
|
7
|
+
*
|
|
8
|
+
* Raster が見本帳(角のある矩形を方眼に敷き詰める)なのに対して、
|
|
9
|
+
* こちらは1粒ずつ間隔をあけて置く。**寸法はテーマの美学**(ADR-06)で、
|
|
10
|
+
* 小さく詰めた見本帳は指では押し分けられない。
|
|
11
|
+
*/
|
|
12
|
+
const slots = {
|
|
13
|
+
root: ["flex flex-col gap-2", disabledState].join(" "),
|
|
14
|
+
label: "text-[length:var(--novi-text-sm)] font-medium text-[var(--novi-color-fg)]",
|
|
15
|
+
description: "text-[length:var(--novi-text-sm)] text-[var(--novi-color-muted)]",
|
|
16
|
+
errorMessage: "text-[length:var(--novi-text-sm)] text-[var(--novi-color-danger)]",
|
|
17
|
+
list: "flex flex-wrap items-start gap-3",
|
|
18
|
+
item: [
|
|
19
|
+
"inline-flex flex-col items-center gap-1.5",
|
|
20
|
+
"cursor-pointer",
|
|
21
|
+
"data-[disabled]:cursor-default",
|
|
22
|
+
tapTarget
|
|
23
|
+
].join(" "),
|
|
24
|
+
/**
|
|
25
|
+
* 色そのものを見せる面。
|
|
26
|
+
*
|
|
27
|
+
* **色は生成 CSS の `--novi-swatch-*` が解決する。** 実装が色値を持たないので、
|
|
28
|
+
* 染料が増えてもここは変わらず、light / dark の追従も生成 CSS 任せになる。
|
|
29
|
+
*/
|
|
30
|
+
swatch: [
|
|
31
|
+
"inline-grid place-items-center",
|
|
32
|
+
"rounded-[var(--novi-radius-full)]",
|
|
33
|
+
"shadow-[var(--novi-shadow-sm)]",
|
|
34
|
+
"transition-[scale,box-shadow]",
|
|
35
|
+
"duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]",
|
|
36
|
+
"group-data-[pressed]:scale-[0.92] motion-reduce:group-data-[pressed]:scale-100",
|
|
37
|
+
"group-data-[selected]:shadow-[var(--novi-shadow-md)]",
|
|
38
|
+
focusRing
|
|
39
|
+
].join(" "),
|
|
40
|
+
indicator: "leading-none",
|
|
41
|
+
itemLabel: "text-[length:var(--novi-text-sm)] text-[var(--novi-color-muted)]"
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* ColorPicker のスタイル定義。
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* import { colorPickerStyles } from '@novi-ui/tactile'
|
|
48
|
+
* import { tv } from 'tailwind-variants'
|
|
49
|
+
*
|
|
50
|
+
* const myPicker = tv({ extend: colorPickerStyles, slots: { list: 'gap-4' } })
|
|
51
|
+
*/
|
|
52
|
+
const colorPickerStyles = tv({
|
|
53
|
+
slots,
|
|
54
|
+
variants: { size: {
|
|
55
|
+
sm: { swatch: "size-8" },
|
|
56
|
+
md: { swatch: "size-11" },
|
|
57
|
+
lg: { swatch: "size-14" }
|
|
58
|
+
} },
|
|
59
|
+
defaultVariants: { size: "md" }
|
|
60
|
+
});
|
|
61
|
+
//#endregion
|
|
62
|
+
export { colorPickerStyles };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=color-picker.styles.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-picker.styles.mjs","names":[],"sources":["../../src/color-picker/color-picker.styles.ts"],"sourcesContent":["import type {\n colorPickerRequiredSlots,\n colorPickerSlots,\n NoviSize,\n SlotMap,\n VariantMap,\n} from '@novi-ui/core'\nimport { tv } from 'tailwind-variants'\nimport { disabledState, focusRing } from '../styles/focus-ring'\nimport { tapTarget } from '../styles/tap-target'\n\n/**\n * Tactile のカラー選択は**染料の玉**。丸く、指で押せる大きさで並べる。\n *\n * Raster が見本帳(角のある矩形を方眼に敷き詰める)なのに対して、\n * こちらは1粒ずつ間隔をあけて置く。**寸法はテーマの美学**(ADR-06)で、\n * 小さく詰めた見本帳は指では押し分けられない。\n */\nconst slots = {\n root: ['flex flex-col gap-2', disabledState].join(' '),\n label: 'text-[length:var(--novi-text-sm)] font-medium text-[var(--novi-color-fg)]',\n description: 'text-[length:var(--novi-text-sm)] text-[var(--novi-color-muted)]',\n errorMessage: 'text-[length:var(--novi-text-sm)] text-[var(--novi-color-danger)]',\n // 玉と玉の間は 12px 空ける。44px の当たり判定どうしが重なると押し間違える\n list: 'flex flex-wrap items-start gap-3',\n item: [\n 'inline-flex flex-col items-center gap-1.5',\n 'cursor-pointer',\n 'data-[disabled]:cursor-default',\n // 見た目の玉は 32〜44px でも、指の当たる範囲は必ず 44px 以上にする\n tapTarget,\n ].join(' '),\n /**\n * 色そのものを見せる面。\n *\n * **色は生成 CSS の `--novi-swatch-*` が解決する。** 実装が色値を持たないので、\n * 染料が増えてもここは変わらず、light / dark の追従も生成 CSS 任せになる。\n */\n swatch: [\n 'inline-grid place-items-center',\n 'rounded-[var(--novi-radius-full)]',\n 'shadow-[var(--novi-shadow-sm)]',\n 'transition-[scale,box-shadow]',\n 'duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]',\n // 押した瞬間だけ沈む。触れている感触をここで返す\n 'group-data-[pressed]:scale-[0.92] motion-reduce:group-data-[pressed]:scale-100',\n // 選択は「持ち上がり」でも示す。色面だけだと選択中が色の違いに埋もれる\n 'group-data-[selected]:shadow-[var(--novi-shadow-md)]',\n focusRing,\n ].join(' '),\n // 色だけに頼らず印でも示す(WCAG 1.4.1)\n indicator: 'leading-none',\n itemLabel: 'text-[length:var(--novi-text-sm)] text-[var(--novi-color-muted)]',\n} satisfies SlotMap<typeof colorPickerSlots, (typeof colorPickerRequiredSlots)[number]>\n\n/**\n * 玉の直径。**最小でも 32px**(Raster の sm は 24px)。\n * 実効タップ領域は `tapTarget` が 44px を保証するので、視覚寸法はここで決めてよい。\n */\nconst size: VariantMap<NoviSize, { swatch: string }> = {\n sm: { swatch: 'size-8' },\n md: { swatch: 'size-11' },\n lg: { swatch: 'size-14' },\n}\n\n/**\n * ColorPicker のスタイル定義。\n *\n * @example\n * import { colorPickerStyles } from '@novi-ui/tactile'\n * import { tv } from 'tailwind-variants'\n *\n * const myPicker = tv({ extend: colorPickerStyles, slots: { list: 'gap-4' } })\n */\nexport const colorPickerStyles = tv({\n slots,\n variants: { size },\n defaultVariants: { size: 'md' },\n})\n\nexport type ColorPickerStyleProps = Parameters<typeof colorPickerStyles>[0]\n"],"mappings":";;;;;;;;;;;AAkBA,MAAM,QAAQ;CACZ,MAAM,CAAC,uBAAuB,aAAa,CAAC,CAAC,KAAK,GAAG;CACrD,OAAO;CACP,aAAa;CACb,cAAc;CAEd,MAAM;CACN,MAAM;EACJ;EACA;EACA;EAEA;CACF,CAAC,CAAC,KAAK,GAAG;;;;;;;CAOV,QAAQ;EACN;EACA;EACA;EACA;EACA;EAEA;EAEA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CAEV,WAAW;CACX,WAAW;AACb;;;;;;;;;;AAqBA,MAAa,oBAAoB,GAAG;CAClC;CACA,UAAU,EAAE;EAhBZ,IAAI,EAAE,QAAQ,SAAS;EACvB,IAAI,EAAE,QAAQ,UAAU;EACxB,IAAI,EAAE,QAAQ,UAAU;CAcZ,EAAK;CACjB,iBAAiB,EAAE,MAAM,KAAK;AAChC,CAAC"}
|
package/dist/index.d.mts
CHANGED
|
@@ -19,6 +19,9 @@ import "./card/index.mjs";
|
|
|
19
19
|
import { Checkbox, CheckboxGroup } from "./checkbox/checkbox.mjs";
|
|
20
20
|
import { CheckboxGroupStyleProps, CheckboxStyleProps, checkboxGroupStyles, checkboxStyles } from "./checkbox/checkbox.styles.mjs";
|
|
21
21
|
import "./checkbox/index.mjs";
|
|
22
|
+
import { COLOR_OPTIONS, ColorPicker } from "./color-picker/color-picker.mjs";
|
|
23
|
+
import { ColorPickerStyleProps, colorPickerStyles } from "./color-picker/color-picker.styles.mjs";
|
|
24
|
+
import "./color-picker/index.mjs";
|
|
22
25
|
import { Input } from "./input/input.mjs";
|
|
23
26
|
import { InputStyleProps, inputStyles } from "./input/input.styles.mjs";
|
|
24
27
|
import "./input/index.mjs";
|
|
@@ -58,4 +61,4 @@ import "./textarea/index.mjs";
|
|
|
58
61
|
import { NoviToast, NoviToastRegion, createToastQueue } from "./toast/toast.mjs";
|
|
59
62
|
import { ToastStyleProps, toastStyles } from "./toast/toast.styles.mjs";
|
|
60
63
|
import "./toast/index.mjs";
|
|
61
|
-
export { Accordion, AccordionItem, type AccordionItemProps, type AccordionStyleProps, Avatar, type AvatarStyleProps, Badge, type BadgeStyleProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsStyleProps, Button, type ButtonStyleProps, Card, CardBody, CardFooter, CardHeader, CardImage, type CardStyleProps, Checkbox, CheckboxGroup, type CheckboxGroupStyleProps, type CheckboxStyleProps, Input, type InputStyleProps, Menu, MenuItemComponent as MenuItem, type MenuItemProps, MenuSection, MenuSeparator, type MenuStyleProps, Modal, ModalBody, ModalFooter, type ModalStyleProps, ModalTitle, type NoviToast, NoviToastRegion, Popover, PopoverContent, type PopoverStyleProps, Progress, type ProgressStyleProps, Radio, RadioGroup, type RadioGroupStyleProps, type RadioStyleProps, Select, SelectItem, type SelectItemProps, type SelectStyleProps, Skeleton, type SkeletonStyleProps, Spinner, type SpinnerStyleProps, Switch, type SwitchStyleProps, TabContent, TabItem, TabItems, Tabs, type TabsStyleProps, TextArea, type TextareaStyleProps, type ToastStyleProps, Tooltip, type TooltipStyleProps, accordionStyles, avatarStyles, badgeStyles, breadcrumbsStyles, buttonStyles, cardStyles, checkboxGroupStyles, checkboxStyles, createToastQueue, initialsOf, inputStyles, menuStyles, modalStyles, popoverStyles, progressStyles, radioGroupStyles, radioStyles, selectStyles, skeletonStyles, spinnerStyles, switchStyles, tabsStyles, textareaStyles, toastStyles, tooltipStyles };
|
|
64
|
+
export { Accordion, AccordionItem, type AccordionItemProps, type AccordionStyleProps, Avatar, type AvatarStyleProps, Badge, type BadgeStyleProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsStyleProps, Button, type ButtonStyleProps, COLOR_OPTIONS, Card, CardBody, CardFooter, CardHeader, CardImage, type CardStyleProps, Checkbox, CheckboxGroup, type CheckboxGroupStyleProps, type CheckboxStyleProps, ColorPicker, type ColorPickerStyleProps, Input, type InputStyleProps, Menu, MenuItemComponent as MenuItem, type MenuItemProps, MenuSection, MenuSeparator, type MenuStyleProps, Modal, ModalBody, ModalFooter, type ModalStyleProps, ModalTitle, type NoviToast, NoviToastRegion, Popover, PopoverContent, type PopoverStyleProps, Progress, type ProgressStyleProps, Radio, RadioGroup, type RadioGroupStyleProps, type RadioStyleProps, Select, SelectItem, type SelectItemProps, type SelectStyleProps, Skeleton, type SkeletonStyleProps, Spinner, type SpinnerStyleProps, Switch, type SwitchStyleProps, TabContent, TabItem, TabItems, Tabs, type TabsStyleProps, TextArea, type TextareaStyleProps, type ToastStyleProps, Tooltip, type TooltipStyleProps, accordionStyles, avatarStyles, badgeStyles, breadcrumbsStyles, buttonStyles, cardStyles, checkboxGroupStyles, checkboxStyles, colorPickerStyles, createToastQueue, initialsOf, inputStyles, menuStyles, modalStyles, popoverStyles, progressStyles, radioGroupStyles, radioStyles, selectStyles, skeletonStyles, spinnerStyles, switchStyles, tabsStyles, textareaStyles, toastStyles, tooltipStyles };
|
package/dist/index.mjs
CHANGED
|
@@ -13,6 +13,8 @@ import { cardStyles } from "./card/card.styles.mjs";
|
|
|
13
13
|
import { Card, CardBody, CardFooter, CardHeader, CardImage } from "./card/card.mjs";
|
|
14
14
|
import { checkboxGroupStyles, checkboxStyles } from "./checkbox/checkbox.styles.mjs";
|
|
15
15
|
import { Checkbox, CheckboxGroup } from "./checkbox/checkbox.mjs";
|
|
16
|
+
import { colorPickerStyles } from "./color-picker/color-picker.styles.mjs";
|
|
17
|
+
import { COLOR_OPTIONS, ColorPicker } from "./color-picker/color-picker.mjs";
|
|
16
18
|
import { inputStyles } from "./input/input.styles.mjs";
|
|
17
19
|
import { Input } from "./input/input.mjs";
|
|
18
20
|
import { menuStyles } from "./menu/menu.styles.mjs";
|
|
@@ -39,4 +41,4 @@ import { textareaStyles } from "./textarea/textarea.styles.mjs";
|
|
|
39
41
|
import { TextArea } from "./textarea/textarea.mjs";
|
|
40
42
|
import { toastStyles } from "./toast/toast.styles.mjs";
|
|
41
43
|
import { NoviToastRegion, createToastQueue } from "./toast/toast.mjs";
|
|
42
|
-
export { Accordion, AccordionItem, Avatar, Badge, Breadcrumb, Breadcrumbs, Button, Card, CardBody, CardFooter, CardHeader, CardImage, Checkbox, CheckboxGroup, Input, Menu, MenuItemComponent as MenuItem, MenuSection, MenuSeparator, Modal, ModalBody, ModalFooter, ModalTitle, NoviToastRegion, Popover, PopoverContent, Progress, Radio, RadioGroup, Select, SelectItem, Skeleton, Spinner, Switch, TabContent, TabItem, TabItems, Tabs, TextArea, Tooltip, accordionStyles, avatarStyles, badgeStyles, breadcrumbsStyles, buttonStyles, cardStyles, checkboxGroupStyles, checkboxStyles, createToastQueue, initialsOf, inputStyles, menuStyles, modalStyles, popoverStyles, progressStyles, radioGroupStyles, radioStyles, selectStyles, skeletonStyles, spinnerStyles, switchStyles, tabsStyles, textareaStyles, toastStyles, tooltipStyles };
|
|
44
|
+
export { Accordion, AccordionItem, Avatar, Badge, Breadcrumb, Breadcrumbs, Button, COLOR_OPTIONS, Card, CardBody, CardFooter, CardHeader, CardImage, Checkbox, CheckboxGroup, ColorPicker, Input, Menu, MenuItemComponent as MenuItem, MenuSection, MenuSeparator, Modal, ModalBody, ModalFooter, ModalTitle, NoviToastRegion, Popover, PopoverContent, Progress, Radio, RadioGroup, Select, SelectItem, Skeleton, Spinner, Switch, TabContent, TabItem, TabItems, Tabs, TextArea, Tooltip, accordionStyles, avatarStyles, badgeStyles, breadcrumbsStyles, buttonStyles, cardStyles, checkboxGroupStyles, checkboxStyles, colorPickerStyles, createToastQueue, initialsOf, inputStyles, menuStyles, modalStyles, popoverStyles, progressStyles, radioGroupStyles, radioStyles, selectStyles, skeletonStyles, spinnerStyles, switchStyles, tabsStyles, textareaStyles, toastStyles, tooltipStyles };
|
|
@@ -22,7 +22,7 @@ declare const inputStyles: import("tailwind-variants").TVReturnType<{
|
|
|
22
22
|
inputWrapper: string;
|
|
23
23
|
input: string;
|
|
24
24
|
}>;
|
|
25
|
-
radius: VariantMap<"
|
|
25
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
26
26
|
inputWrapper: string;
|
|
27
27
|
}>;
|
|
28
28
|
}, {
|
|
@@ -42,7 +42,7 @@ declare const inputStyles: import("tailwind-variants").TVReturnType<{
|
|
|
42
42
|
inputWrapper: string;
|
|
43
43
|
input: string;
|
|
44
44
|
}>;
|
|
45
|
-
radius: VariantMap<"
|
|
45
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
46
46
|
inputWrapper: string;
|
|
47
47
|
}>;
|
|
48
48
|
}, {
|
|
@@ -62,7 +62,7 @@ declare const inputStyles: import("tailwind-variants").TVReturnType<{
|
|
|
62
62
|
inputWrapper: string;
|
|
63
63
|
input: string;
|
|
64
64
|
}>;
|
|
65
|
-
radius: VariantMap<"
|
|
65
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
66
66
|
inputWrapper: string;
|
|
67
67
|
}>;
|
|
68
68
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.styles.d.mts","names":[],"sources":["../../src/menu/menu.styles.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"menu.styles.d.mts","names":[],"sources":["../../src/menu/menu.styles.ts"],"mappings":";;;;;;;cA8Ca,wCAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEX,iBAAiB,kBAAkB"}
|
|
@@ -11,6 +11,7 @@ const slots = {
|
|
|
11
11
|
"rounded-t-[var(--novi-radius-lg)]",
|
|
12
12
|
"shadow-[var(--novi-shadow-lg)]",
|
|
13
13
|
"pb-[env(safe-area-inset-bottom,0px)]",
|
|
14
|
+
"pl-[env(safe-area-inset-left,0px)] pr-[env(safe-area-inset-right,0px)]",
|
|
14
15
|
"data-[entering]:motion-safe:animate-[novi-fade-in_120ms_ease-out]"
|
|
15
16
|
].join(" "),
|
|
16
17
|
list: "outline-none p-2 flex flex-col",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.styles.mjs","names":[],"sources":["../../src/menu/menu.styles.ts"],"sourcesContent":["import type { menuRequiredSlots, menuSlots, SlotMap } from '@novi-ui/core'\nimport { tv } from 'tailwind-variants'\n\nconst slots = {\n trigger: 'outline-none',\n // Select と同じ下端シート。RAC の位置決めを奪えるのは !important だけ(ADR-T2)\n popover: [\n 'text-[var(--novi-color-fg)]',\n 'outline-none',\n '!fixed !top-auto !inset-x-0 !bottom-0 !max-w-none !w-full',\n '!max-h-[70dvh]',\n 'bg-[var(--novi-color-surface)]',\n 'rounded-t-[var(--novi-radius-lg)]',\n 'shadow-[var(--novi-shadow-lg)]',\n 'pb-[env(safe-area-inset-bottom,0px)]',\n 'data-[entering]:motion-safe:animate-[novi-fade-in_120ms_ease-out]',\n ].join(' '),\n list: 'outline-none p-2 flex flex-col',\n item: [\n 'flex items-center gap-3 justify-between',\n // 一覧は誤タップが最も起きる場所。行高は 48px を下回らせない\n 'min-h-12 px-3 cursor-pointer outline-none',\n 'text-[var(--novi-color-fg)]',\n 'rounded-[var(--novi-radius-md)]',\n 'data-[focused]:bg-[var(--novi-color-subtle)]',\n 'data-[disabled]:opacity-40 data-[disabled]:cursor-default',\n ].join(' '),\n itemLabel: 'truncate',\n itemDescription: 'text-[length:var(--novi-text-xs)] text-[var(--novi-color-muted)]',\n // ショートカットは桁を揃える。等幅数字にしないと縦の線が揃わない\n itemShortcut:\n 'shrink-0 text-[length:var(--novi-text-xs)] text-[var(--novi-color-muted)] tabular-nums',\n separator: 'my-1 h-px bg-[var(--novi-color-border)]',\n section: 'flex flex-col',\n sectionLabel:\n 'px-2 pt-2 pb-1 text-[length:var(--novi-text-xs)] text-[var(--novi-color-muted)] tracking-wide',\n} satisfies SlotMap<typeof menuSlots, (typeof menuRequiredSlots)[number]>\n\n/**\n * Menu のスタイル定義。\n *\n * @example\n * const myMenu = tv({ extend: menuStyles, slots: { popover: 'min-w-56' } })\n */\nexport const menuStyles = tv({ slots })\n\nexport type MenuStyleProps = Parameters<typeof menuStyles>[0]\n"],"mappings":";;AAGA,MAAM,QAAQ;CACZ,SAAS;CAET,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,MAAM;CACN,MAAM;EACJ;EAEA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,WAAW;CACX,iBAAiB;CAEjB,cACE;CACF,WAAW;CACX,SAAS;CACT,cACE;AACJ;;;;;;;AAQA,MAAa,aAAa,GAAG,EAAE,MAAM,CAAC"}
|
|
1
|
+
{"version":3,"file":"menu.styles.mjs","names":[],"sources":["../../src/menu/menu.styles.ts"],"sourcesContent":["import type { menuRequiredSlots, menuSlots, SlotMap } from '@novi-ui/core'\nimport { tv } from 'tailwind-variants'\n\nconst slots = {\n trigger: 'outline-none',\n // Select と同じ下端シート。RAC の位置決めを奪えるのは !important だけ(ADR-T2)\n popover: [\n 'text-[var(--novi-color-fg)]',\n 'outline-none',\n '!fixed !top-auto !inset-x-0 !bottom-0 !max-w-none !w-full',\n '!max-h-[70dvh]',\n 'bg-[var(--novi-color-surface)]',\n 'rounded-t-[var(--novi-radius-lg)]',\n 'shadow-[var(--novi-shadow-lg)]',\n 'pb-[env(safe-area-inset-bottom,0px)]',\n // 横向きのノッチは左右に来る。面は全幅のまま、中身だけを内側へ寄せる(FR-13)\n 'pl-[env(safe-area-inset-left,0px)] pr-[env(safe-area-inset-right,0px)]',\n 'data-[entering]:motion-safe:animate-[novi-fade-in_120ms_ease-out]',\n ].join(' '),\n list: 'outline-none p-2 flex flex-col',\n item: [\n 'flex items-center gap-3 justify-between',\n // 一覧は誤タップが最も起きる場所。行高は 48px を下回らせない\n 'min-h-12 px-3 cursor-pointer outline-none',\n 'text-[var(--novi-color-fg)]',\n 'rounded-[var(--novi-radius-md)]',\n 'data-[focused]:bg-[var(--novi-color-subtle)]',\n 'data-[disabled]:opacity-40 data-[disabled]:cursor-default',\n ].join(' '),\n itemLabel: 'truncate',\n itemDescription: 'text-[length:var(--novi-text-xs)] text-[var(--novi-color-muted)]',\n // ショートカットは桁を揃える。等幅数字にしないと縦の線が揃わない\n itemShortcut:\n 'shrink-0 text-[length:var(--novi-text-xs)] text-[var(--novi-color-muted)] tabular-nums',\n separator: 'my-1 h-px bg-[var(--novi-color-border)]',\n section: 'flex flex-col',\n sectionLabel:\n 'px-2 pt-2 pb-1 text-[length:var(--novi-text-xs)] text-[var(--novi-color-muted)] tracking-wide',\n} satisfies SlotMap<typeof menuSlots, (typeof menuRequiredSlots)[number]>\n\n/**\n * Menu のスタイル定義。\n *\n * @example\n * const myMenu = tv({ extend: menuStyles, slots: { popover: 'min-w-56' } })\n */\nexport const menuStyles = tv({ slots })\n\nexport type MenuStyleProps = Parameters<typeof menuStyles>[0]\n"],"mappings":";;AAGA,MAAM,QAAQ;CACZ,SAAS;CAET,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,MAAM;CACN,MAAM;EACJ;EAEA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,WAAW;CACX,iBAAiB;CAEjB,cACE;CACF,WAAW;CACX,SAAS;CACT,cACE;AACJ;;;;;;;AAQA,MAAa,aAAa,GAAG,EAAE,MAAM,CAAC"}
|
|
@@ -13,7 +13,7 @@ declare const modalStyles: import("tailwind-variants").TVReturnType<{
|
|
|
13
13
|
size: VariantMap<"sm" | "md" | "lg" | "full", {
|
|
14
14
|
panel: string;
|
|
15
15
|
}>;
|
|
16
|
-
radius: VariantMap<"
|
|
16
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
17
17
|
panel: string;
|
|
18
18
|
}>;
|
|
19
19
|
}, {
|
|
@@ -27,7 +27,7 @@ declare const modalStyles: import("tailwind-variants").TVReturnType<{
|
|
|
27
27
|
size: VariantMap<"sm" | "md" | "lg" | "full", {
|
|
28
28
|
panel: string;
|
|
29
29
|
}>;
|
|
30
|
-
radius: VariantMap<"
|
|
30
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
31
31
|
panel: string;
|
|
32
32
|
}>;
|
|
33
33
|
}, {
|
|
@@ -41,7 +41,7 @@ declare const modalStyles: import("tailwind-variants").TVReturnType<{
|
|
|
41
41
|
size: VariantMap<"sm" | "md" | "lg" | "full", {
|
|
42
42
|
panel: string;
|
|
43
43
|
}>;
|
|
44
|
-
radius: VariantMap<"
|
|
44
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
45
45
|
panel: string;
|
|
46
46
|
}>;
|
|
47
47
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.styles.d.mts","names":[],"sources":["../../src/modal/modal.styles.ts"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"modal.styles.d.mts","names":[],"sources":["../../src/modal/modal.styles.ts"],"mappings":";;;;;;;;;;;cA8Fa,yCAAW;;IAzB2B;;;IAQL;;;;;;;;;;;IARK;;;IAQL;;;;;;;;;;;IARK;;;IAQL;;;;;;;;;;KAuBlC,kBAAkB,kBAAkB"}
|
|
@@ -23,6 +23,7 @@ const slots = {
|
|
|
23
23
|
"shadow-[var(--novi-shadow-lg)]",
|
|
24
24
|
"overflow-auto",
|
|
25
25
|
"pb-[env(safe-area-inset-bottom,0px)]",
|
|
26
|
+
"pl-[env(safe-area-inset-left,0px)] pr-[env(safe-area-inset-right,0px)]",
|
|
26
27
|
"data-[entering]:motion-safe:animate-[novi-slide-up_260ms_var(--novi-ease-emphasized)]"
|
|
27
28
|
].join(" "),
|
|
28
29
|
title: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.styles.mjs","names":[],"sources":["../../src/modal/modal.styles.ts"],"sourcesContent":["import type {\n modalRequiredSlots,\n modalSlots,\n NoviRadius,\n NoviSize,\n SlotMap,\n VariantMap,\n} from '@novi-ui/core'\nimport { tv } from 'tailwind-variants'\nimport { focusRing } from '../styles/focus-ring'\n\n/**\n * Tactile の Modal は **下端から出るボトムシート**(architecture.md §5 テーマB)。\n *\n * Raster との構造差:\n * - 中央配置 → 画面下端に張り付く(`items-end`)\n * - ヘッダー行に ✕ → **フッターのフルワイドボタン**(親指の届く位置に出口を置く)\n * - 上下すべて角丸 → **上端だけ角丸**(下から出てきた紙という形)\n * - 影は下向き → **上向き**(下端から来る面には上から光が当たる)\n */\nconst slots = {\n backdrop: [\n // items-end が「下から出る」の全て。Raster は place-items-center\n 'fixed inset-0 z-50 flex items-end justify-center',\n 'bg-[var(--novi-color-overlay)]',\n 'data-[entering]:motion-safe:animate-[novi-fade-in_200ms_ease-out]',\n ].join(' '),\n panel: [\n 'text-[var(--novi-color-fg)]',\n 'w-full outline-none',\n 'bg-[var(--novi-color-surface)]',\n 'shadow-[var(--novi-shadow-lg)]',\n 'overflow-auto',\n // 下端の余白はホームインジケータぶんを足す。env() の第2引数で\n // safe-area の無い環境(デスクトップ)では 0 に落ちる(AC-10-3 / FR-13)\n 'pb-[env(safe-area-inset-bottom,0px)]',\n // 下から せり上がる。260ms は移動距離に見合う時間(120ms では瞬間移動に見える)\n 'data-[entering]:motion-safe:animate-[novi-slide-up_260ms_var(--novi-ease-emphasized)]',\n ].join(' '),\n // header は描画しない(任意 slot の省略)。title だけが body の上に載る\n title: [\n 'px-5 pt-5 pb-2',\n 'text-[length:var(--novi-text-lg)] font-bold',\n 'text-[var(--novi-color-fg)]',\n ].join(' '),\n closeButton: [\n // フルワイド。指がどこに落ちても当たる\n 'w-full h-14 grid place-items-center',\n 'text-[length:var(--novi-text-base)] font-bold',\n 'text-[var(--novi-color-fg)]',\n 'bg-[var(--novi-color-subtle)]',\n 'rounded-[var(--novi-radius-md)]',\n 'transition-[background-color,scale] duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]',\n 'data-[pressed]:scale-[0.97] motion-reduce:data-[pressed]:scale-100',\n focusRing,\n ].join(' '),\n body: ['px-5 pb-5 pt-1', 'text-[var(--novi-color-fg)] leading-[var(--novi-leading-body)]'].join(\n ' ',\n ),\n // 縦積み。横並びだと1つあたりの幅が指に対して狭くなる\n footer: 'flex flex-col gap-2 px-5 pb-5',\n} satisfies SlotMap<typeof modalSlots, (typeof modalRequiredSlots)[number]>\n\n/**\n * 全幅シートに幅の段階は存在しないため、`size` は**最大高**として解釈する(ADR-T3)。\n * 語彙は共通、解釈はテーマの自由(ADR-06)。\n */\nconst size: VariantMap<NoviSize | 'full', { panel: string }> = {\n sm: { panel: 'max-h-[40dvh]' },\n md: { panel: 'max-h-[60dvh]' },\n lg: { panel: 'max-h-[80dvh]' },\n full: { panel: 'max-h-[100dvh] h-[100dvh]' },\n}\n\n/** 下端は画面に接しているので、角丸は上端だけに効く。 */\nconst radius: VariantMap<NoviRadius, { panel: string }> = {\n none: { panel: 'rounded-t-[var(--novi-radius-none)]' },\n sm: { panel: 'rounded-t-[var(--novi-radius-sm)]' },\n md: { panel: 'rounded-t-[var(--novi-radius-md)]' },\n lg: { panel: 'rounded-t-[var(--novi-radius-lg)]' },\n full: { panel: 'rounded-t-[var(--novi-radius-full)]' },\n}\n\n/**\n * Modal のスタイル定義。\n *\n * @example\n * import { modalStyles } from '@novi-ui/tactile'\n * import { tv } from 'tailwind-variants'\n *\n * const myModal = tv({ extend: modalStyles, slots: { panel: 'max-h-[50dvh]' } })\n */\nexport const modalStyles = tv({\n slots,\n variants: { size, radius },\n defaultVariants: { size: 'md', radius: 'lg' },\n})\n\nexport type ModalStyleProps = Parameters<typeof modalStyles>[0]\n\n/**\n * シート上端の掴み手。**装飾であり slot ではない**(architecture.md §5 の運用)。\n *\n * ドラッグ開閉は MVP の対象外(NG6)なので、掴めそうに見せすぎない。\n * 細く低コントラストにして「シートの上端」を示す線に留める。\n */\nexport const grabberClass = [\n 'mx-auto mt-2 mb-1 h-1 w-9 shrink-0',\n 'rounded-[var(--novi-radius-full)]',\n 'bg-[var(--novi-color-border)]',\n].join(' ')\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAM,QAAQ;CACZ,UAAU;EAER;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,OAAO;EACL;EACA;EACA;EACA;EACA;EAGA;EAEA;CACF,CAAC,CAAC,KAAK,GAAG;CAEV,OAAO;EACL;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,aAAa;EAEX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,MAAM,CAAC,kBAAkB,gEAAgE,CAAC,CAAC,KACzF,GACF;CAEA,QAAQ;AACV;;;;;;;;;;AA+BA,MAAa,cAAc,GAAG;CAC5B;CACA,UAAU;EAAE;GA1BZ,IAAI,EAAE,OAAO,gBAAgB;GAC7B,IAAI,EAAE,OAAO,gBAAgB;GAC7B,IAAI,EAAE,OAAO,gBAAgB;GAC7B,MAAM,EAAE,OAAO,4BAA4B;EAuB/B;EAAM;GAlBlB,MAAM,EAAE,OAAO,sCAAsC;GACrD,IAAI,EAAE,OAAO,oCAAoC;GACjD,IAAI,EAAE,OAAO,oCAAoC;GACjD,IAAI,EAAE,OAAO,oCAAoC;GACjD,MAAM,EAAE,OAAO,sCAAsC;EAcnC;CAAO;CACzB,iBAAiB;EAAE,MAAM;EAAM,QAAQ;CAAK;AAC9C,CAAC;;;;;;;AAUD,MAAa,eAAe;CAC1B;CACA;CACA;AACF,CAAC,CAAC,KAAK,GAAG"}
|
|
1
|
+
{"version":3,"file":"modal.styles.mjs","names":[],"sources":["../../src/modal/modal.styles.ts"],"sourcesContent":["import type {\n modalRequiredSlots,\n modalSlots,\n NoviRadius,\n NoviSize,\n SlotMap,\n VariantMap,\n} from '@novi-ui/core'\nimport { tv } from 'tailwind-variants'\nimport { focusRing } from '../styles/focus-ring'\n\n/**\n * Tactile の Modal は **下端から出るボトムシート**(architecture.md §5 テーマB)。\n *\n * Raster との構造差:\n * - 中央配置 → 画面下端に張り付く(`items-end`)\n * - ヘッダー行に ✕ → **フッターのフルワイドボタン**(親指の届く位置に出口を置く)\n * - 上下すべて角丸 → **上端だけ角丸**(下から出てきた紙という形)\n * - 影は下向き → **上向き**(下端から来る面には上から光が当たる)\n */\nconst slots = {\n backdrop: [\n // items-end が「下から出る」の全て。Raster は place-items-center\n 'fixed inset-0 z-50 flex items-end justify-center',\n 'bg-[var(--novi-color-overlay)]',\n 'data-[entering]:motion-safe:animate-[novi-fade-in_200ms_ease-out]',\n ].join(' '),\n panel: [\n 'text-[var(--novi-color-fg)]',\n 'w-full outline-none',\n 'bg-[var(--novi-color-surface)]',\n 'shadow-[var(--novi-shadow-lg)]',\n 'overflow-auto',\n // 下端の余白はホームインジケータぶんを足す。env() の第2引数で\n // safe-area の無い環境(デスクトップ)では 0 に落ちる(AC-10-3 / FR-13)\n 'pb-[env(safe-area-inset-bottom,0px)]',\n // 横向きではノッチが左右に来る。面は画面幅いっぱいのまま、中身だけを内側へ寄せる\n 'pl-[env(safe-area-inset-left,0px)] pr-[env(safe-area-inset-right,0px)]',\n // 下から せり上がる。260ms は移動距離に見合う時間(120ms では瞬間移動に見える)\n 'data-[entering]:motion-safe:animate-[novi-slide-up_260ms_var(--novi-ease-emphasized)]',\n ].join(' '),\n // header は描画しない(任意 slot の省略)。title だけが body の上に載る\n title: [\n 'px-5 pt-5 pb-2',\n 'text-[length:var(--novi-text-lg)] font-bold',\n 'text-[var(--novi-color-fg)]',\n ].join(' '),\n closeButton: [\n // フルワイド。指がどこに落ちても当たる\n 'w-full h-14 grid place-items-center',\n 'text-[length:var(--novi-text-base)] font-bold',\n 'text-[var(--novi-color-fg)]',\n 'bg-[var(--novi-color-subtle)]',\n 'rounded-[var(--novi-radius-md)]',\n 'transition-[background-color,scale] duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]',\n 'data-[pressed]:scale-[0.97] motion-reduce:data-[pressed]:scale-100',\n focusRing,\n ].join(' '),\n body: ['px-5 pb-5 pt-1', 'text-[var(--novi-color-fg)] leading-[var(--novi-leading-body)]'].join(\n ' ',\n ),\n // 縦積み。横並びだと1つあたりの幅が指に対して狭くなる\n footer: 'flex flex-col gap-2 px-5 pb-5',\n} satisfies SlotMap<typeof modalSlots, (typeof modalRequiredSlots)[number]>\n\n/**\n * 全幅シートに幅の段階は存在しないため、`size` は**最大高**として解釈する(ADR-T3)。\n * 語彙は共通、解釈はテーマの自由(ADR-06)。\n */\nconst size: VariantMap<NoviSize | 'full', { panel: string }> = {\n sm: { panel: 'max-h-[40dvh]' },\n md: { panel: 'max-h-[60dvh]' },\n lg: { panel: 'max-h-[80dvh]' },\n full: { panel: 'max-h-[100dvh] h-[100dvh]' },\n}\n\n/** 下端は画面に接しているので、角丸は上端だけに効く。 */\nconst radius: VariantMap<NoviRadius, { panel: string }> = {\n none: { panel: 'rounded-t-[var(--novi-radius-none)]' },\n sm: { panel: 'rounded-t-[var(--novi-radius-sm)]' },\n md: { panel: 'rounded-t-[var(--novi-radius-md)]' },\n lg: { panel: 'rounded-t-[var(--novi-radius-lg)]' },\n full: { panel: 'rounded-t-[var(--novi-radius-full)]' },\n}\n\n/**\n * Modal のスタイル定義。\n *\n * @example\n * import { modalStyles } from '@novi-ui/tactile'\n * import { tv } from 'tailwind-variants'\n *\n * const myModal = tv({ extend: modalStyles, slots: { panel: 'max-h-[50dvh]' } })\n */\nexport const modalStyles = tv({\n slots,\n variants: { size, radius },\n defaultVariants: { size: 'md', radius: 'lg' },\n})\n\nexport type ModalStyleProps = Parameters<typeof modalStyles>[0]\n\n/**\n * シート上端の掴み手。**装飾であり slot ではない**(architecture.md §5 の運用)。\n *\n * ドラッグ開閉は MVP の対象外(NG6)なので、掴めそうに見せすぎない。\n * 細く低コントラストにして「シートの上端」を示す線に留める。\n */\nexport const grabberClass = [\n 'mx-auto mt-2 mb-1 h-1 w-9 shrink-0',\n 'rounded-[var(--novi-radius-full)]',\n 'bg-[var(--novi-color-border)]',\n].join(' ')\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAM,QAAQ;CACZ,UAAU;EAER;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,OAAO;EACL;EACA;EACA;EACA;EACA;EAGA;EAEA;EAEA;CACF,CAAC,CAAC,KAAK,GAAG;CAEV,OAAO;EACL;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,aAAa;EAEX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,MAAM,CAAC,kBAAkB,gEAAgE,CAAC,CAAC,KACzF,GACF;CAEA,QAAQ;AACV;;;;;;;;;;AA+BA,MAAa,cAAc,GAAG;CAC5B;CACA,UAAU;EAAE;GA1BZ,IAAI,EAAE,OAAO,gBAAgB;GAC7B,IAAI,EAAE,OAAO,gBAAgB;GAC7B,IAAI,EAAE,OAAO,gBAAgB;GAC7B,MAAM,EAAE,OAAO,4BAA4B;EAuB/B;EAAM;GAlBlB,MAAM,EAAE,OAAO,sCAAsC;GACrD,IAAI,EAAE,OAAO,oCAAoC;GACjD,IAAI,EAAE,OAAO,oCAAoC;GACjD,IAAI,EAAE,OAAO,oCAAoC;GACjD,MAAM,EAAE,OAAO,sCAAsC;EAcnC;CAAO;CACzB,iBAAiB;EAAE,MAAM;EAAM,QAAQ;CAAK;AAC9C,CAAC;;;;;;;AAUD,MAAa,eAAe;CAC1B;CACA;CACA;AACF,CAAC,CAAC,KAAK,GAAG"}
|
|
@@ -7,7 +7,7 @@ import { VariantMap } from "@novi-ui/core";
|
|
|
7
7
|
* const myPopover = tv({ extend: popoverStyles, slots: { content: 'p-6' } })
|
|
8
8
|
*/
|
|
9
9
|
declare const popoverStyles: import("tailwind-variants").TVReturnType<{
|
|
10
|
-
radius: VariantMap<"
|
|
10
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
11
11
|
root: string;
|
|
12
12
|
}>;
|
|
13
13
|
}, {
|
|
@@ -15,7 +15,7 @@ declare const popoverStyles: import("tailwind-variants").TVReturnType<{
|
|
|
15
15
|
arrow: string;
|
|
16
16
|
content: string;
|
|
17
17
|
}, undefined, {
|
|
18
|
-
radius: VariantMap<"
|
|
18
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
19
19
|
root: string;
|
|
20
20
|
}>;
|
|
21
21
|
}, {
|
|
@@ -23,7 +23,7 @@ declare const popoverStyles: import("tailwind-variants").TVReturnType<{
|
|
|
23
23
|
arrow: string;
|
|
24
24
|
content: string;
|
|
25
25
|
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
26
|
-
radius: VariantMap<"
|
|
26
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
27
27
|
root: string;
|
|
28
28
|
}>;
|
|
29
29
|
}, {
|
|
@@ -17,7 +17,7 @@ declare const selectStyles: import("tailwind-variants").TVReturnType<{
|
|
|
17
17
|
trigger: string;
|
|
18
18
|
option: string;
|
|
19
19
|
}>;
|
|
20
|
-
radius: VariantMap<"
|
|
20
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
21
21
|
trigger: string;
|
|
22
22
|
}>;
|
|
23
23
|
variant: VariantMap<"solid" | "outline" | "soft" | "ghost" | "plain", {
|
|
@@ -39,7 +39,7 @@ declare const selectStyles: import("tailwind-variants").TVReturnType<{
|
|
|
39
39
|
trigger: string;
|
|
40
40
|
option: string;
|
|
41
41
|
}>;
|
|
42
|
-
radius: VariantMap<"
|
|
42
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
43
43
|
trigger: string;
|
|
44
44
|
}>;
|
|
45
45
|
variant: VariantMap<"solid" | "outline" | "soft" | "ghost" | "plain", {
|
|
@@ -61,7 +61,7 @@ declare const selectStyles: import("tailwind-variants").TVReturnType<{
|
|
|
61
61
|
trigger: string;
|
|
62
62
|
option: string;
|
|
63
63
|
}>;
|
|
64
|
-
radius: VariantMap<"
|
|
64
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
65
65
|
trigger: string;
|
|
66
66
|
}>;
|
|
67
67
|
variant: VariantMap<"solid" | "outline" | "soft" | "ghost" | "plain", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.styles.d.mts","names":[],"sources":["../../src/select/select.styles.ts"],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"select.styles.d.mts","names":[],"sources":["../../src/select/select.styles.ts"],"mappings":";;;;;;;;;;;;;;cA4Ha,0CAAY;;IAhDmB;IAAgB;;;IAeZ;;;IAQE;;;;;;;;;;;;;;;IAvBN;IAAgB;;;IAeZ;;;IAQE;;;;;;;;;;;;;;;IAvBN;IAAgB;;;IAeZ;;;IAQE;;;;;;;;;;;;;;KA+BtC,mBAAmB,kBAAkB"}
|
|
@@ -37,6 +37,7 @@ const slots = {
|
|
|
37
37
|
"shadow-[var(--novi-shadow-lg)]",
|
|
38
38
|
"overflow-auto",
|
|
39
39
|
"pb-[env(safe-area-inset-bottom,0px)]",
|
|
40
|
+
"pl-[env(safe-area-inset-left,0px)] pr-[env(safe-area-inset-right,0px)]",
|
|
40
41
|
"data-[entering]:motion-safe:animate-[novi-slide-up_260ms_var(--novi-ease-emphasized)]"
|
|
41
42
|
].join(" "),
|
|
42
43
|
listbox: "outline-none p-2 flex flex-col",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.styles.mjs","names":[],"sources":["../../src/select/select.styles.ts"],"sourcesContent":["import type {\n NoviRadius,\n NoviSize,\n NoviVariant,\n SlotMap,\n selectRequiredSlots,\n selectSlots,\n VariantMap,\n} from '@novi-ui/core'\nimport { tv } from 'tailwind-variants'\nimport { disabledState, focusRing } from '../styles/focus-ring'\n\n/**\n * Tactile の Select は **画面下端から出るシート型ピッカー**(Raster はアンカー型ポップオーバー)。\n *\n * 一覧は誤タップが最も起きる場所なので、行を大きく取り、選択済みをチェックで示す。\n *\n * **`!` 付きのユーティリティは意図的**。RAC の `Popover` はトリガー基準の位置を\n * インラインスタイルで書き込むため、通常のクラスでも `style` prop でも勝てない。\n * スタイルシートの `!important` だけがインラインに勝つ(ADR-T2 / T-13 の実測)。\n */\nconst slots = {\n root: 'flex flex-col gap-1.5',\n label: 'text-[length:var(--novi-text-sm)] font-medium text-[var(--novi-color-fg)]',\n trigger: [\n 'text-[var(--novi-color-fg)]',\n 'flex items-center justify-between gap-2 w-full',\n 'text-left',\n 'bg-[var(--novi-color-surface)]',\n 'shadow-[var(--novi-shadow-sm)]',\n 'rounded-[var(--novi-radius-md)]',\n 'transition-[opacity,scale] duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]',\n 'data-[pressed]:scale-[0.99] motion-reduce:data-[pressed]:scale-100',\n 'group-data-[invalid]:ring-1 group-data-[invalid]:ring-[var(--novi-color-danger)]',\n focusRing,\n disabledState,\n ].join(' '),\n value: [\n 'truncate text-[var(--novi-color-fg)]',\n 'data-[placeholder]:text-[var(--novi-color-muted)]',\n ].join(' '),\n icon: 'shrink-0 text-[var(--novi-color-muted)]',\n popover: [\n // ここが Raster との構造差そのもの。トリガーの隣ではなく画面下端に張り付く\n '!fixed !top-auto !inset-x-0 !bottom-0 !max-w-none !w-full',\n '!max-h-[70dvh]',\n 'bg-[var(--novi-color-surface)]',\n 'text-[var(--novi-color-fg)]',\n // 下端は画面に接するので上端だけ角丸。下から出てきた紙の形\n 'rounded-t-[var(--novi-radius-lg)]',\n 'shadow-[var(--novi-shadow-lg)]',\n 'overflow-auto',\n 'pb-[env(safe-area-inset-bottom,0px)]',\n 'data-[entering]:motion-safe:animate-[novi-slide-up_260ms_var(--novi-ease-emphasized)]',\n ].join(' '),\n listbox: 'outline-none p-2 flex flex-col',\n option: [\n 'flex items-center justify-between gap-3',\n 'px-3 cursor-pointer outline-none',\n 'text-[var(--novi-color-fg)]',\n 'rounded-[var(--novi-radius-md)]',\n 'transition-[background-color] duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]',\n 'data-[focused]:bg-[var(--novi-color-subtle)]',\n 'data-[selected]:font-bold',\n disabledState,\n ].join(' '),\n description: 'text-[length:var(--novi-text-sm)] text-[var(--novi-color-muted)]',\n errorMessage: 'text-[length:var(--novi-text-sm)] text-[var(--novi-color-danger)]',\n} satisfies SlotMap<typeof selectSlots, (typeof selectRequiredSlots)[number]>\n\n/**\n * `size` はトリガーの寸法と**行の密度**(ADR-T3)。\n * 行はどの段でも 48px を下回らない — 一覧は誤タップが最も起きる場所。\n */\nconst size: VariantMap<NoviSize, { trigger: string; option: string }> = {\n sm: {\n trigger: 'h-10 px-3 text-[length:var(--novi-text-sm)]',\n option: 'h-12 text-[length:var(--novi-text-sm)]',\n },\n md: {\n trigger: 'h-12 px-4 text-[length:var(--novi-text-base)]',\n option: 'h-14 text-[length:var(--novi-text-base)]',\n },\n lg: {\n trigger: 'h-14 px-5 text-[length:var(--novi-text-base)]',\n option: 'h-16 text-[length:var(--novi-text-base)]',\n },\n}\n\nconst radius: VariantMap<NoviRadius, { trigger: string }> = {\n none: { trigger: 'rounded-[var(--novi-radius-none)]' },\n sm: { trigger: 'rounded-[var(--novi-radius-sm)]' },\n md: { trigger: 'rounded-[var(--novi-radius-md)]' },\n lg: { trigger: 'rounded-[var(--novi-radius-lg)]' },\n full: { trigger: 'rounded-[var(--novi-radius-full)]' },\n}\n\nconst variant: VariantMap<NoviVariant, { trigger: string }> = {\n solid: { trigger: 'bg-[var(--novi-color-surface)]' },\n outline: {\n trigger:\n 'bg-transparent shadow-[var(--novi-shadow-none)] ring-1 ring-[var(--novi-color-border-strong)]',\n },\n soft: { trigger: 'bg-[var(--novi-color-subtle)] shadow-[var(--novi-shadow-none)]' },\n ghost: { trigger: 'bg-transparent shadow-[var(--novi-shadow-none)]' },\n plain: {\n trigger: 'bg-transparent shadow-[var(--novi-shadow-none)] px-0 underline underline-offset-4',\n },\n}\n\n/**\n * Select のスタイル定義。\n *\n * `popover` の `!` 付きクラスを `classNames` で上書きすることはできない\n * (`!important` 同士では後勝ちにならない)。配置を変えたい場合は `tv({ extend })` を使う。\n *\n * @example\n * import { selectStyles } from '@novi-ui/tactile'\n * import { tv } from 'tailwind-variants'\n *\n * const mySelect = tv({ extend: selectStyles, slots: { option: 'font-mono' } })\n */\nexport const selectStyles = tv({\n slots,\n variants: { size, radius, variant },\n defaultVariants: { size: 'md', radius: 'md', variant: 'solid' },\n})\n\nexport type SelectStyleProps = Parameters<typeof selectStyles>[0]\n"],"mappings":";;;;;;;;;;;;AAqBA,MAAM,QAAQ;CACZ,MAAM;CACN,OAAO;CACP,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,OAAO,CACL,wCACA,mDACF,CAAC,CAAC,KAAK,GAAG;CACV,MAAM;CACN,SAAS;EAEP;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,SAAS;CACT,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,aAAa;CACb,cAAc;AAChB;;;;;;;;;;;;;AAsDA,MAAa,eAAe,GAAG;CAC7B;CACA,UAAU;EAAE;GAjDZ,IAAI;IACF,SAAS;IACT,QAAQ;GACV;GACA,IAAI;IACF,SAAS;IACT,QAAQ;GACV;GACA,IAAI;IACF,SAAS;IACT,QAAQ;GACV;EAsCY;EAAM;GAlClB,MAAM,EAAE,SAAS,oCAAoC;GACrD,IAAI,EAAE,SAAS,kCAAkC;GACjD,IAAI,EAAE,SAAS,kCAAkC;GACjD,IAAI,EAAE,SAAS,kCAAkC;GACjD,MAAM,EAAE,SAAS,oCAAoC;EA8BnC;EAAQ;GA1B1B,OAAO,EAAE,SAAS,iCAAiC;GACnD,SAAS,EACP,SACE,gGACJ;GACA,MAAM,EAAE,SAAS,iEAAiE;GAClF,OAAO,EAAE,SAAS,kDAAkD;GACpE,OAAO,EACL,SAAS,oFACX;EAiB0B;CAAQ;CAClC,iBAAiB;EAAE,MAAM;EAAM,QAAQ;EAAM,SAAS;CAAQ;AAChE,CAAC"}
|
|
1
|
+
{"version":3,"file":"select.styles.mjs","names":[],"sources":["../../src/select/select.styles.ts"],"sourcesContent":["import type {\n NoviRadius,\n NoviSize,\n NoviVariant,\n SlotMap,\n selectRequiredSlots,\n selectSlots,\n VariantMap,\n} from '@novi-ui/core'\nimport { tv } from 'tailwind-variants'\nimport { disabledState, focusRing } from '../styles/focus-ring'\n\n/**\n * Tactile の Select は **画面下端から出るシート型ピッカー**(Raster はアンカー型ポップオーバー)。\n *\n * 一覧は誤タップが最も起きる場所なので、行を大きく取り、選択済みをチェックで示す。\n *\n * **`!` 付きのユーティリティは意図的**。RAC の `Popover` はトリガー基準の位置を\n * インラインスタイルで書き込むため、通常のクラスでも `style` prop でも勝てない。\n * スタイルシートの `!important` だけがインラインに勝つ(ADR-T2 / T-13 の実測)。\n */\nconst slots = {\n root: 'flex flex-col gap-1.5',\n label: 'text-[length:var(--novi-text-sm)] font-medium text-[var(--novi-color-fg)]',\n trigger: [\n 'text-[var(--novi-color-fg)]',\n 'flex items-center justify-between gap-2 w-full',\n 'text-left',\n 'bg-[var(--novi-color-surface)]',\n 'shadow-[var(--novi-shadow-sm)]',\n 'rounded-[var(--novi-radius-md)]',\n 'transition-[opacity,scale] duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]',\n 'data-[pressed]:scale-[0.99] motion-reduce:data-[pressed]:scale-100',\n 'group-data-[invalid]:ring-1 group-data-[invalid]:ring-[var(--novi-color-danger)]',\n focusRing,\n disabledState,\n ].join(' '),\n value: [\n 'truncate text-[var(--novi-color-fg)]',\n 'data-[placeholder]:text-[var(--novi-color-muted)]',\n ].join(' '),\n icon: 'shrink-0 text-[var(--novi-color-muted)]',\n popover: [\n // ここが Raster との構造差そのもの。トリガーの隣ではなく画面下端に張り付く\n '!fixed !top-auto !inset-x-0 !bottom-0 !max-w-none !w-full',\n '!max-h-[70dvh]',\n 'bg-[var(--novi-color-surface)]',\n 'text-[var(--novi-color-fg)]',\n // 下端は画面に接するので上端だけ角丸。下から出てきた紙の形\n 'rounded-t-[var(--novi-radius-lg)]',\n 'shadow-[var(--novi-shadow-lg)]',\n 'overflow-auto',\n 'pb-[env(safe-area-inset-bottom,0px)]',\n // 横向きのノッチは左右に来る。面は全幅のまま、中身だけを内側へ寄せる(FR-13)\n 'pl-[env(safe-area-inset-left,0px)] pr-[env(safe-area-inset-right,0px)]',\n 'data-[entering]:motion-safe:animate-[novi-slide-up_260ms_var(--novi-ease-emphasized)]',\n ].join(' '),\n listbox: 'outline-none p-2 flex flex-col',\n option: [\n 'flex items-center justify-between gap-3',\n 'px-3 cursor-pointer outline-none',\n 'text-[var(--novi-color-fg)]',\n 'rounded-[var(--novi-radius-md)]',\n 'transition-[background-color] duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]',\n 'data-[focused]:bg-[var(--novi-color-subtle)]',\n 'data-[selected]:font-bold',\n disabledState,\n ].join(' '),\n description: 'text-[length:var(--novi-text-sm)] text-[var(--novi-color-muted)]',\n errorMessage: 'text-[length:var(--novi-text-sm)] text-[var(--novi-color-danger)]',\n} satisfies SlotMap<typeof selectSlots, (typeof selectRequiredSlots)[number]>\n\n/**\n * `size` はトリガーの寸法と**行の密度**(ADR-T3)。\n * 行はどの段でも 48px を下回らない — 一覧は誤タップが最も起きる場所。\n */\nconst size: VariantMap<NoviSize, { trigger: string; option: string }> = {\n sm: {\n trigger: 'h-10 px-3 text-[length:var(--novi-text-sm)]',\n option: 'h-12 text-[length:var(--novi-text-sm)]',\n },\n md: {\n trigger: 'h-12 px-4 text-[length:var(--novi-text-base)]',\n option: 'h-14 text-[length:var(--novi-text-base)]',\n },\n lg: {\n trigger: 'h-14 px-5 text-[length:var(--novi-text-base)]',\n option: 'h-16 text-[length:var(--novi-text-base)]',\n },\n}\n\nconst radius: VariantMap<NoviRadius, { trigger: string }> = {\n none: { trigger: 'rounded-[var(--novi-radius-none)]' },\n sm: { trigger: 'rounded-[var(--novi-radius-sm)]' },\n md: { trigger: 'rounded-[var(--novi-radius-md)]' },\n lg: { trigger: 'rounded-[var(--novi-radius-lg)]' },\n full: { trigger: 'rounded-[var(--novi-radius-full)]' },\n}\n\nconst variant: VariantMap<NoviVariant, { trigger: string }> = {\n solid: { trigger: 'bg-[var(--novi-color-surface)]' },\n outline: {\n trigger:\n 'bg-transparent shadow-[var(--novi-shadow-none)] ring-1 ring-[var(--novi-color-border-strong)]',\n },\n soft: { trigger: 'bg-[var(--novi-color-subtle)] shadow-[var(--novi-shadow-none)]' },\n ghost: { trigger: 'bg-transparent shadow-[var(--novi-shadow-none)]' },\n plain: {\n trigger: 'bg-transparent shadow-[var(--novi-shadow-none)] px-0 underline underline-offset-4',\n },\n}\n\n/**\n * Select のスタイル定義。\n *\n * `popover` の `!` 付きクラスを `classNames` で上書きすることはできない\n * (`!important` 同士では後勝ちにならない)。配置を変えたい場合は `tv({ extend })` を使う。\n *\n * @example\n * import { selectStyles } from '@novi-ui/tactile'\n * import { tv } from 'tailwind-variants'\n *\n * const mySelect = tv({ extend: selectStyles, slots: { option: 'font-mono' } })\n */\nexport const selectStyles = tv({\n slots,\n variants: { size, radius, variant },\n defaultVariants: { size: 'md', radius: 'md', variant: 'solid' },\n})\n\nexport type SelectStyleProps = Parameters<typeof selectStyles>[0]\n"],"mappings":";;;;;;;;;;;;AAqBA,MAAM,QAAQ;CACZ,MAAM;CACN,OAAO;CACP,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,OAAO,CACL,wCACA,mDACF,CAAC,CAAC,KAAK,GAAG;CACV,MAAM;CACN,SAAS;EAEP;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,SAAS;CACT,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,aAAa;CACb,cAAc;AAChB;;;;;;;;;;;;;AAsDA,MAAa,eAAe,GAAG;CAC7B;CACA,UAAU;EAAE;GAjDZ,IAAI;IACF,SAAS;IACT,QAAQ;GACV;GACA,IAAI;IACF,SAAS;IACT,QAAQ;GACV;GACA,IAAI;IACF,SAAS;IACT,QAAQ;GACV;EAsCY;EAAM;GAlClB,MAAM,EAAE,SAAS,oCAAoC;GACrD,IAAI,EAAE,SAAS,kCAAkC;GACjD,IAAI,EAAE,SAAS,kCAAkC;GACjD,IAAI,EAAE,SAAS,kCAAkC;GACjD,MAAM,EAAE,SAAS,oCAAoC;EA8BnC;EAAQ;GA1B1B,OAAO,EAAE,SAAS,iCAAiC;GACnD,SAAS,EACP,SACE,gGACJ;GACA,MAAM,EAAE,SAAS,iEAAiE;GAClF,OAAO,EAAE,SAAS,kDAAkD;GACpE,OAAO,EACL,SAAS,oFACX;EAiB0B;CAAQ;CAClC,iBAAiB;EAAE,MAAM;EAAM,QAAQ;EAAM,SAAS;CAAQ;AAChE,CAAC"}
|
|
@@ -7,19 +7,19 @@ import { VariantMap } from "@novi-ui/core";
|
|
|
7
7
|
* const mySkeleton = tv({ extend: skeletonStyles, slots: { root: 'opacity-50' } })
|
|
8
8
|
*/
|
|
9
9
|
declare const skeletonStyles: import("tailwind-variants").TVReturnType<{
|
|
10
|
-
radius: VariantMap<"
|
|
10
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
11
11
|
root: string;
|
|
12
12
|
}>;
|
|
13
13
|
}, {
|
|
14
14
|
root: string;
|
|
15
15
|
}, undefined, {
|
|
16
|
-
radius: VariantMap<"
|
|
16
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
17
17
|
root: string;
|
|
18
18
|
}>;
|
|
19
19
|
}, {
|
|
20
20
|
root: string;
|
|
21
21
|
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
22
|
-
radius: VariantMap<"
|
|
22
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
23
23
|
root: string;
|
|
24
24
|
}>;
|
|
25
25
|
}, {
|
package/dist/tactile.css
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
--novi-radius-md: 14px;
|
|
18
18
|
--novi-radius-lg: 20px;
|
|
19
19
|
--novi-radius-full: 9999px;
|
|
20
|
-
--novi-shadow-none:
|
|
20
|
+
--novi-shadow-none: 0 0 #0000;
|
|
21
21
|
--novi-shadow-sm: 0 1px 3px oklch(20% 0.01 255 / 0.10), 0 1px 2px oklch(20% 0.01 255 / 0.06);
|
|
22
22
|
--novi-shadow-md: 0 6px 16px oklch(20% 0.01 255 / 0.14), 0 2px 4px oklch(20% 0.01 255 / 0.08);
|
|
23
23
|
--novi-shadow-lg: 0 -8px 32px oklch(20% 0.01 255 / 0.18), 0 -2px 8px oklch(20% 0.01 255 / 0.08);
|
|
@@ -54,6 +54,22 @@
|
|
|
54
54
|
--novi-color-warning-fg: oklch(98.5% 0.004 62);
|
|
55
55
|
--novi-color-danger: oklch(50% 0.16 27);
|
|
56
56
|
--novi-color-danger-fg: oklch(98.5% 0.004 27);
|
|
57
|
+
--novi-swatch-indigo: oklch(50% 0.08 255);
|
|
58
|
+
--novi-swatch-indigo-fg: oklch(98.5% 0.004 255);
|
|
59
|
+
--novi-swatch-peacock: oklch(50% 0.08 200);
|
|
60
|
+
--novi-swatch-peacock-fg: oklch(98.5% 0.004 200);
|
|
61
|
+
--novi-swatch-sage: oklch(50% 0.08 148);
|
|
62
|
+
--novi-swatch-sage-fg: oklch(98.5% 0.004 148);
|
|
63
|
+
--novi-swatch-saffron: oklch(50% 0.08 78);
|
|
64
|
+
--novi-swatch-saffron-fg: oklch(98.5% 0.004 78);
|
|
65
|
+
--novi-swatch-madder: oklch(50% 0.08 28);
|
|
66
|
+
--novi-swatch-madder-fg: oklch(98.5% 0.004 28);
|
|
67
|
+
--novi-swatch-cochineal: oklch(50% 0.08 5);
|
|
68
|
+
--novi-swatch-cochineal-fg: oklch(98.5% 0.004 5);
|
|
69
|
+
--novi-swatch-mauve: oklch(50% 0.08 315);
|
|
70
|
+
--novi-swatch-mauve-fg: oklch(98.5% 0.004 315);
|
|
71
|
+
--novi-swatch-greige: oklch(50% 0.022 80);
|
|
72
|
+
--novi-swatch-greige-fg: oklch(98.5% 0.004 80);
|
|
57
73
|
}
|
|
58
74
|
|
|
59
75
|
[data-novi-scheme='dark'] {
|
|
@@ -77,6 +93,22 @@
|
|
|
77
93
|
--novi-color-warning-fg: oklch(18% 0.02 65);
|
|
78
94
|
--novi-color-danger: oklch(74% 0.14 27);
|
|
79
95
|
--novi-color-danger-fg: oklch(18% 0.02 27);
|
|
96
|
+
--novi-swatch-indigo: oklch(76% 0.075 255);
|
|
97
|
+
--novi-swatch-indigo-fg: oklch(18% 0.02 255);
|
|
98
|
+
--novi-swatch-peacock: oklch(76% 0.075 200);
|
|
99
|
+
--novi-swatch-peacock-fg: oklch(18% 0.02 200);
|
|
100
|
+
--novi-swatch-sage: oklch(76% 0.075 148);
|
|
101
|
+
--novi-swatch-sage-fg: oklch(18% 0.02 148);
|
|
102
|
+
--novi-swatch-saffron: oklch(76% 0.075 78);
|
|
103
|
+
--novi-swatch-saffron-fg: oklch(18% 0.02 78);
|
|
104
|
+
--novi-swatch-madder: oklch(76% 0.075 28);
|
|
105
|
+
--novi-swatch-madder-fg: oklch(18% 0.02 28);
|
|
106
|
+
--novi-swatch-cochineal: oklch(76% 0.075 5);
|
|
107
|
+
--novi-swatch-cochineal-fg: oklch(18% 0.02 5);
|
|
108
|
+
--novi-swatch-mauve: oklch(76% 0.075 315);
|
|
109
|
+
--novi-swatch-mauve-fg: oklch(18% 0.02 315);
|
|
110
|
+
--novi-swatch-greige: oklch(76% 0.018 80);
|
|
111
|
+
--novi-swatch-greige-fg: oklch(18% 0.02 80);
|
|
80
112
|
}
|
|
81
113
|
|
|
82
114
|
@media (prefers-color-scheme: dark) {
|
|
@@ -101,6 +133,22 @@
|
|
|
101
133
|
--novi-color-warning-fg: oklch(18% 0.02 65);
|
|
102
134
|
--novi-color-danger: oklch(74% 0.14 27);
|
|
103
135
|
--novi-color-danger-fg: oklch(18% 0.02 27);
|
|
136
|
+
--novi-swatch-indigo: oklch(76% 0.075 255);
|
|
137
|
+
--novi-swatch-indigo-fg: oklch(18% 0.02 255);
|
|
138
|
+
--novi-swatch-peacock: oklch(76% 0.075 200);
|
|
139
|
+
--novi-swatch-peacock-fg: oklch(18% 0.02 200);
|
|
140
|
+
--novi-swatch-sage: oklch(76% 0.075 148);
|
|
141
|
+
--novi-swatch-sage-fg: oklch(18% 0.02 148);
|
|
142
|
+
--novi-swatch-saffron: oklch(76% 0.075 78);
|
|
143
|
+
--novi-swatch-saffron-fg: oklch(18% 0.02 78);
|
|
144
|
+
--novi-swatch-madder: oklch(76% 0.075 28);
|
|
145
|
+
--novi-swatch-madder-fg: oklch(18% 0.02 28);
|
|
146
|
+
--novi-swatch-cochineal: oklch(76% 0.075 5);
|
|
147
|
+
--novi-swatch-cochineal-fg: oklch(18% 0.02 5);
|
|
148
|
+
--novi-swatch-mauve: oklch(76% 0.075 315);
|
|
149
|
+
--novi-swatch-mauve-fg: oklch(18% 0.02 315);
|
|
150
|
+
--novi-swatch-greige: oklch(76% 0.018 80);
|
|
151
|
+
--novi-swatch-greige-fg: oklch(18% 0.02 80);
|
|
104
152
|
}
|
|
105
153
|
}
|
|
106
154
|
|
package/dist/tactile.scoped.css
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
--novi-radius-md: 14px;
|
|
18
18
|
--novi-radius-lg: 20px;
|
|
19
19
|
--novi-radius-full: 9999px;
|
|
20
|
-
--novi-shadow-none:
|
|
20
|
+
--novi-shadow-none: 0 0 #0000;
|
|
21
21
|
--novi-shadow-sm: 0 1px 3px oklch(20% 0.01 255 / 0.10), 0 1px 2px oklch(20% 0.01 255 / 0.06);
|
|
22
22
|
--novi-shadow-md: 0 6px 16px oklch(20% 0.01 255 / 0.14), 0 2px 4px oklch(20% 0.01 255 / 0.08);
|
|
23
23
|
--novi-shadow-lg: 0 -8px 32px oklch(20% 0.01 255 / 0.18), 0 -2px 8px oklch(20% 0.01 255 / 0.08);
|
|
@@ -54,6 +54,22 @@
|
|
|
54
54
|
--novi-color-warning-fg: oklch(98.5% 0.004 62);
|
|
55
55
|
--novi-color-danger: oklch(50% 0.16 27);
|
|
56
56
|
--novi-color-danger-fg: oklch(98.5% 0.004 27);
|
|
57
|
+
--novi-swatch-indigo: oklch(50% 0.08 255);
|
|
58
|
+
--novi-swatch-indigo-fg: oklch(98.5% 0.004 255);
|
|
59
|
+
--novi-swatch-peacock: oklch(50% 0.08 200);
|
|
60
|
+
--novi-swatch-peacock-fg: oklch(98.5% 0.004 200);
|
|
61
|
+
--novi-swatch-sage: oklch(50% 0.08 148);
|
|
62
|
+
--novi-swatch-sage-fg: oklch(98.5% 0.004 148);
|
|
63
|
+
--novi-swatch-saffron: oklch(50% 0.08 78);
|
|
64
|
+
--novi-swatch-saffron-fg: oklch(98.5% 0.004 78);
|
|
65
|
+
--novi-swatch-madder: oklch(50% 0.08 28);
|
|
66
|
+
--novi-swatch-madder-fg: oklch(98.5% 0.004 28);
|
|
67
|
+
--novi-swatch-cochineal: oklch(50% 0.08 5);
|
|
68
|
+
--novi-swatch-cochineal-fg: oklch(98.5% 0.004 5);
|
|
69
|
+
--novi-swatch-mauve: oklch(50% 0.08 315);
|
|
70
|
+
--novi-swatch-mauve-fg: oklch(98.5% 0.004 315);
|
|
71
|
+
--novi-swatch-greige: oklch(50% 0.022 80);
|
|
72
|
+
--novi-swatch-greige-fg: oklch(98.5% 0.004 80);
|
|
57
73
|
}
|
|
58
74
|
|
|
59
75
|
[data-novi-theme='tactile'][data-novi-scheme='dark'] {
|
|
@@ -77,6 +93,22 @@
|
|
|
77
93
|
--novi-color-warning-fg: oklch(18% 0.02 65);
|
|
78
94
|
--novi-color-danger: oklch(74% 0.14 27);
|
|
79
95
|
--novi-color-danger-fg: oklch(18% 0.02 27);
|
|
96
|
+
--novi-swatch-indigo: oklch(76% 0.075 255);
|
|
97
|
+
--novi-swatch-indigo-fg: oklch(18% 0.02 255);
|
|
98
|
+
--novi-swatch-peacock: oklch(76% 0.075 200);
|
|
99
|
+
--novi-swatch-peacock-fg: oklch(18% 0.02 200);
|
|
100
|
+
--novi-swatch-sage: oklch(76% 0.075 148);
|
|
101
|
+
--novi-swatch-sage-fg: oklch(18% 0.02 148);
|
|
102
|
+
--novi-swatch-saffron: oklch(76% 0.075 78);
|
|
103
|
+
--novi-swatch-saffron-fg: oklch(18% 0.02 78);
|
|
104
|
+
--novi-swatch-madder: oklch(76% 0.075 28);
|
|
105
|
+
--novi-swatch-madder-fg: oklch(18% 0.02 28);
|
|
106
|
+
--novi-swatch-cochineal: oklch(76% 0.075 5);
|
|
107
|
+
--novi-swatch-cochineal-fg: oklch(18% 0.02 5);
|
|
108
|
+
--novi-swatch-mauve: oklch(76% 0.075 315);
|
|
109
|
+
--novi-swatch-mauve-fg: oklch(18% 0.02 315);
|
|
110
|
+
--novi-swatch-greige: oklch(76% 0.018 80);
|
|
111
|
+
--novi-swatch-greige-fg: oklch(18% 0.02 80);
|
|
80
112
|
}
|
|
81
113
|
|
|
82
114
|
@media (prefers-color-scheme: dark) {
|
|
@@ -101,6 +133,22 @@
|
|
|
101
133
|
--novi-color-warning-fg: oklch(18% 0.02 65);
|
|
102
134
|
--novi-color-danger: oklch(74% 0.14 27);
|
|
103
135
|
--novi-color-danger-fg: oklch(18% 0.02 27);
|
|
136
|
+
--novi-swatch-indigo: oklch(76% 0.075 255);
|
|
137
|
+
--novi-swatch-indigo-fg: oklch(18% 0.02 255);
|
|
138
|
+
--novi-swatch-peacock: oklch(76% 0.075 200);
|
|
139
|
+
--novi-swatch-peacock-fg: oklch(18% 0.02 200);
|
|
140
|
+
--novi-swatch-sage: oklch(76% 0.075 148);
|
|
141
|
+
--novi-swatch-sage-fg: oklch(18% 0.02 148);
|
|
142
|
+
--novi-swatch-saffron: oklch(76% 0.075 78);
|
|
143
|
+
--novi-swatch-saffron-fg: oklch(18% 0.02 78);
|
|
144
|
+
--novi-swatch-madder: oklch(76% 0.075 28);
|
|
145
|
+
--novi-swatch-madder-fg: oklch(18% 0.02 28);
|
|
146
|
+
--novi-swatch-cochineal: oklch(76% 0.075 5);
|
|
147
|
+
--novi-swatch-cochineal-fg: oklch(18% 0.02 5);
|
|
148
|
+
--novi-swatch-mauve: oklch(76% 0.075 315);
|
|
149
|
+
--novi-swatch-mauve-fg: oklch(18% 0.02 315);
|
|
150
|
+
--novi-swatch-greige: oklch(76% 0.018 80);
|
|
151
|
+
--novi-swatch-greige-fg: oklch(18% 0.02 80);
|
|
104
152
|
}
|
|
105
153
|
}
|
|
106
154
|
|
|
@@ -20,7 +20,7 @@ declare const textareaStyles: import("tailwind-variants").TVReturnType<{
|
|
|
20
20
|
inputWrapper: string;
|
|
21
21
|
textarea: string;
|
|
22
22
|
}>;
|
|
23
|
-
radius: VariantMap<"
|
|
23
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
24
24
|
inputWrapper: string;
|
|
25
25
|
}>;
|
|
26
26
|
}, {
|
|
@@ -38,7 +38,7 @@ declare const textareaStyles: import("tailwind-variants").TVReturnType<{
|
|
|
38
38
|
inputWrapper: string;
|
|
39
39
|
textarea: string;
|
|
40
40
|
}>;
|
|
41
|
-
radius: VariantMap<"
|
|
41
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
42
42
|
inputWrapper: string;
|
|
43
43
|
}>;
|
|
44
44
|
}, {
|
|
@@ -56,7 +56,7 @@ declare const textareaStyles: import("tailwind-variants").TVReturnType<{
|
|
|
56
56
|
inputWrapper: string;
|
|
57
57
|
textarea: string;
|
|
58
58
|
}>;
|
|
59
|
-
radius: VariantMap<"
|
|
59
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
60
60
|
inputWrapper: string;
|
|
61
61
|
}>;
|
|
62
62
|
}, {
|
|
@@ -10,7 +10,7 @@ declare const toastStyles: import("tailwind-variants").TVReturnType<{
|
|
|
10
10
|
color: VariantMap<"default" | "primary" | "secondary" | "success" | "warning" | "danger", {
|
|
11
11
|
root: string;
|
|
12
12
|
}>;
|
|
13
|
-
radius: VariantMap<"
|
|
13
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
14
14
|
root: string;
|
|
15
15
|
}>;
|
|
16
16
|
}, {
|
|
@@ -26,7 +26,7 @@ declare const toastStyles: import("tailwind-variants").TVReturnType<{
|
|
|
26
26
|
color: VariantMap<"default" | "primary" | "secondary" | "success" | "warning" | "danger", {
|
|
27
27
|
root: string;
|
|
28
28
|
}>;
|
|
29
|
-
radius: VariantMap<"
|
|
29
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
30
30
|
root: string;
|
|
31
31
|
}>;
|
|
32
32
|
}, {
|
|
@@ -42,7 +42,7 @@ declare const toastStyles: import("tailwind-variants").TVReturnType<{
|
|
|
42
42
|
color: VariantMap<"default" | "primary" | "secondary" | "success" | "warning" | "danger", {
|
|
43
43
|
root: string;
|
|
44
44
|
}>;
|
|
45
|
-
radius: VariantMap<"
|
|
45
|
+
radius: VariantMap<"none" | "sm" | "md" | "lg" | "full", {
|
|
46
46
|
root: string;
|
|
47
47
|
}>;
|
|
48
48
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.styles.d.mts","names":[],"sources":["../../src/toast/toast.styles.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"toast.styles.d.mts","names":[],"sources":["../../src/toast/toast.styles.ts"],"mappings":";;;;;;;;cAmEa,yCAAW;;IAvBmB;;;IASE;;;;;;;;;;;;;IATF;;;IASE;;;;;;;;;;;;;IATF;;;IASE;;;;;;;;;;;;KAoBjC,kBAAkB,kBAAkB"}
|
|
@@ -2,7 +2,12 @@ import { focusRing } from "../styles/focus-ring.mjs";
|
|
|
2
2
|
import { tv } from "tailwind-variants";
|
|
3
3
|
//#region src/toast/toast.styles.ts
|
|
4
4
|
const slots = {
|
|
5
|
-
region: [
|
|
5
|
+
region: [
|
|
6
|
+
"fixed top-0 inset-x-0 z-50 flex flex-col gap-2 outline-none",
|
|
7
|
+
"p-3 pt-[calc(env(safe-area-inset-top,0px)+0.75rem)]",
|
|
8
|
+
"pl-[calc(env(safe-area-inset-left,0px)+0.75rem)]",
|
|
9
|
+
"pr-[calc(env(safe-area-inset-right,0px)+0.75rem)]"
|
|
10
|
+
].join(" "),
|
|
6
11
|
root: [
|
|
7
12
|
"text-[var(--novi-color-fg)]",
|
|
8
13
|
"flex items-start gap-3 px-4 py-3 outline-none",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.styles.mjs","names":[],"sources":["../../src/toast/toast.styles.ts"],"sourcesContent":["import type {\n NoviColor,\n NoviRadius,\n SlotMap,\n toastRequiredSlots,\n toastSlots,\n VariantMap,\n} from '@novi-ui/core'\nimport { tv } from 'tailwind-variants'\nimport { focusRing } from '../styles/focus-ring'\n\nconst slots = {\n // 右下に固定する。操作の起点から遠く、視線移動が最小になる位置\n // 上端に出すのは、下端がシートとソフトウェアキーボードに占有されるため。\n // safe-area(top) はノッチぶんを避ける\n region: [\n 'fixed top-0 inset-x-0 z-50 flex flex-col gap-2 outline-none',\n 'p-3 pt-[calc(env(safe-area-inset-top,0px)+0.75rem)]',\n ].join(' '),\n root: [\n 'text-[var(--novi-color-fg)]',\n 'flex items-start gap-3 px-4 py-3 outline-none',\n 'bg-[var(--novi-color-surface)]',\n 'rounded-[var(--novi-radius-lg)]',\n 'shadow-[var(--novi-shadow-md)]',\n 'data-[entering]:motion-safe:animate-[novi-fade-in_200ms_ease-out]',\n ].join(' '),\n icon: 'shrink-0 mt-0.5 text-[var(--c)]',\n content: 'flex-1 min-w-0 flex flex-col gap-0.5',\n title: 'font-medium text-[var(--novi-color-fg)]',\n description:\n 'text-[length:var(--novi-text-sm)] text-[var(--novi-color-muted)] leading-[var(--novi-leading-body)]',\n closeButton: [\n 'shrink-0 grid place-items-center size-6 -mr-1',\n 'text-[var(--novi-color-muted)] hover:text-[var(--novi-color-fg)]',\n 'transition-colors duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]',\n focusRing,\n ].join(' '),\n action: 'shrink-0',\n} satisfies SlotMap<typeof toastSlots, (typeof toastRequiredSlots)[number]>\n\nconst color: VariantMap<NoviColor, { root: string }> = {\n default: { root: '[--c:var(--novi-color-fg)]' },\n primary: { root: '[--c:var(--novi-color-primary)]' },\n secondary: { root: '[--c:var(--novi-color-secondary)]' },\n success: { root: '[--c:var(--novi-color-success)] border-l-[var(--novi-color-success)]' },\n warning: { root: '[--c:var(--novi-color-warning)] border-l-[var(--novi-color-warning)]' },\n danger: { root: '[--c:var(--novi-color-danger)] border-l-[var(--novi-color-danger)]' },\n}\n\nconst radius: VariantMap<NoviRadius, { root: string }> = {\n none: { root: 'rounded-[var(--novi-radius-none)]' },\n sm: { root: 'rounded-[var(--novi-radius-sm)]' },\n md: { root: 'rounded-[var(--novi-radius-md)]' },\n lg: { root: 'rounded-[var(--novi-radius-lg)]' },\n full: { root: 'rounded-[var(--novi-radius-full)]' },\n}\n\n/**\n * Toast のスタイル定義。\n *\n * @example\n * const myToast = tv({ extend: toastStyles, slots: { region: 'bottom-8' } })\n */\nexport const toastStyles = tv({\n slots,\n variants: { color, radius },\n defaultVariants: { color: 'default', radius: 'lg' },\n})\n\nexport type ToastStyleProps = Parameters<typeof toastStyles>[0]\n"],"mappings":";;;AAWA,MAAM,QAAQ;CAIZ,QAAQ,
|
|
1
|
+
{"version":3,"file":"toast.styles.mjs","names":[],"sources":["../../src/toast/toast.styles.ts"],"sourcesContent":["import type {\n NoviColor,\n NoviRadius,\n SlotMap,\n toastRequiredSlots,\n toastSlots,\n VariantMap,\n} from '@novi-ui/core'\nimport { tv } from 'tailwind-variants'\nimport { focusRing } from '../styles/focus-ring'\n\nconst slots = {\n // 右下に固定する。操作の起点から遠く、視線移動が最小になる位置\n // 上端に出すのは、下端がシートとソフトウェアキーボードに占有されるため。\n // safe-area(top) はノッチぶんを避ける\n region: [\n 'fixed top-0 inset-x-0 z-50 flex flex-col gap-2 outline-none',\n 'p-3 pt-[calc(env(safe-area-inset-top,0px)+0.75rem)]',\n // 横向きではノッチが左右に来る。上端だけ避けても通知はノッチに隠れる(FR-13)\n 'pl-[calc(env(safe-area-inset-left,0px)+0.75rem)]',\n 'pr-[calc(env(safe-area-inset-right,0px)+0.75rem)]',\n ].join(' '),\n root: [\n 'text-[var(--novi-color-fg)]',\n 'flex items-start gap-3 px-4 py-3 outline-none',\n 'bg-[var(--novi-color-surface)]',\n 'rounded-[var(--novi-radius-lg)]',\n 'shadow-[var(--novi-shadow-md)]',\n 'data-[entering]:motion-safe:animate-[novi-fade-in_200ms_ease-out]',\n ].join(' '),\n icon: 'shrink-0 mt-0.5 text-[var(--c)]',\n content: 'flex-1 min-w-0 flex flex-col gap-0.5',\n title: 'font-medium text-[var(--novi-color-fg)]',\n description:\n 'text-[length:var(--novi-text-sm)] text-[var(--novi-color-muted)] leading-[var(--novi-leading-body)]',\n closeButton: [\n 'shrink-0 grid place-items-center size-6 -mr-1',\n 'text-[var(--novi-color-muted)] hover:text-[var(--novi-color-fg)]',\n 'transition-colors duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]',\n focusRing,\n ].join(' '),\n action: 'shrink-0',\n} satisfies SlotMap<typeof toastSlots, (typeof toastRequiredSlots)[number]>\n\nconst color: VariantMap<NoviColor, { root: string }> = {\n default: { root: '[--c:var(--novi-color-fg)]' },\n primary: { root: '[--c:var(--novi-color-primary)]' },\n secondary: { root: '[--c:var(--novi-color-secondary)]' },\n success: { root: '[--c:var(--novi-color-success)] border-l-[var(--novi-color-success)]' },\n warning: { root: '[--c:var(--novi-color-warning)] border-l-[var(--novi-color-warning)]' },\n danger: { root: '[--c:var(--novi-color-danger)] border-l-[var(--novi-color-danger)]' },\n}\n\nconst radius: VariantMap<NoviRadius, { root: string }> = {\n none: { root: 'rounded-[var(--novi-radius-none)]' },\n sm: { root: 'rounded-[var(--novi-radius-sm)]' },\n md: { root: 'rounded-[var(--novi-radius-md)]' },\n lg: { root: 'rounded-[var(--novi-radius-lg)]' },\n full: { root: 'rounded-[var(--novi-radius-full)]' },\n}\n\n/**\n * Toast のスタイル定義。\n *\n * @example\n * const myToast = tv({ extend: toastStyles, slots: { region: 'bottom-8' } })\n */\nexport const toastStyles = tv({\n slots,\n variants: { color, radius },\n defaultVariants: { color: 'default', radius: 'lg' },\n})\n\nexport type ToastStyleProps = Parameters<typeof toastStyles>[0]\n"],"mappings":";;;AAWA,MAAM,QAAQ;CAIZ,QAAQ;EACN;EACA;EAEA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,MAAM;CACN,SAAS;CACT,OAAO;CACP,aACE;CACF,aAAa;EACX;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,QAAQ;AACV;;;;;;;AAyBA,MAAa,cAAc,GAAG;CAC5B;CACA,UAAU;EAAE;GAxBZ,SAAS,EAAE,MAAM,6BAA6B;GAC9C,SAAS,EAAE,MAAM,kCAAkC;GACnD,WAAW,EAAE,MAAM,oCAAoC;GACvD,SAAS,EAAE,MAAM,uEAAuE;GACxF,SAAS,EAAE,MAAM,uEAAuE;GACxF,QAAQ,EAAE,MAAM,qEAAqE;EAmBzE;EAAO;GAfnB,MAAM,EAAE,MAAM,oCAAoC;GAClD,IAAI,EAAE,MAAM,kCAAkC;GAC9C,IAAI,EAAE,MAAM,kCAAkC;GAC9C,IAAI,EAAE,MAAM,kCAAkC;GAC9C,MAAM,EAAE,MAAM,oCAAoC;EAW/B;CAAO;CAC1B,iBAAiB;EAAE,OAAO;EAAW,QAAQ;CAAK;AACpD,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
//#region src/tokens/color-set.ts
|
|
2
|
+
/**
|
|
3
|
+
* Textile Dyes のトーン。
|
|
4
|
+
*
|
|
5
|
+
* light の L50 は掃引で決めた値。**律速は常に Peacock を `subtle` 面に置いたとき**で、
|
|
6
|
+
* L52 では余裕が 0.1 を切り、L54 以上はどの C でも 4.5:1 に届かない。
|
|
7
|
+
* L50 なら 4.93 で、丸めや将来の微調整に耐える余裕が残る。
|
|
8
|
+
* Raster(L44)との差は 6 ポイントで、トーンはモデルの識別子として機能する。
|
|
9
|
+
*/
|
|
10
|
+
const TACTILE_TONE = {
|
|
11
|
+
light: {
|
|
12
|
+
l: 50,
|
|
13
|
+
c: .08
|
|
14
|
+
},
|
|
15
|
+
dark: {
|
|
16
|
+
l: 76,
|
|
17
|
+
c: .075
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* 8色。全色が布を染めてきた染料の実名を持つ。
|
|
22
|
+
* 紫・青緑・ピンクは Raster に無く、ここにある。入れる色と入れない色でモデルの性格を作る。
|
|
23
|
+
*/
|
|
24
|
+
const COLOR_DEFS = [
|
|
25
|
+
{
|
|
26
|
+
id: "indigo",
|
|
27
|
+
name: "Indigo",
|
|
28
|
+
hue: 255,
|
|
29
|
+
pair: "saffron",
|
|
30
|
+
description: "藍。デニムを染めた染料。既定色"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "peacock",
|
|
34
|
+
name: "Peacock",
|
|
35
|
+
hue: 200,
|
|
36
|
+
pair: "madder",
|
|
37
|
+
description: "孔雀の青緑。羽の見る角度の色"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "sage",
|
|
41
|
+
name: "Sage",
|
|
42
|
+
hue: 148,
|
|
43
|
+
pair: "cochineal",
|
|
44
|
+
description: "セージの葉。くすみグリーンの定番"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: "saffron",
|
|
48
|
+
name: "Saffron",
|
|
49
|
+
hue: 78,
|
|
50
|
+
pair: "indigo",
|
|
51
|
+
description: "サフラン。染料にも香辛料にもなる黄"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: "madder",
|
|
55
|
+
name: "Madder",
|
|
56
|
+
hue: 28,
|
|
57
|
+
pair: "peacock",
|
|
58
|
+
description: "茜。人類最古級の赤い染料"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: "cochineal",
|
|
62
|
+
name: "Cochineal",
|
|
63
|
+
hue: 5,
|
|
64
|
+
pair: "sage",
|
|
65
|
+
description: "コチニール。紅を生む染料"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: "mauve",
|
|
69
|
+
name: "Mauve",
|
|
70
|
+
hue: 315,
|
|
71
|
+
pair: "sage",
|
|
72
|
+
description: "モーブ。1856年、史上初の合成染料"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: "greige",
|
|
76
|
+
name: "Greige",
|
|
77
|
+
hue: 80,
|
|
78
|
+
pair: "indigo",
|
|
79
|
+
description: "生機。染める前の布の色。無彩枠",
|
|
80
|
+
fixedC: .022,
|
|
81
|
+
fixedCDark: .018
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
/** `data-novi-color` 未指定・未知の名前のときに効く色(FR-05) */
|
|
85
|
+
const DEFAULT_COLOR_ID = "indigo";
|
|
86
|
+
const oklch = (l, c, hue) => `oklch(${l}% ${c} ${hue})`;
|
|
87
|
+
/** primary の面に乗る文字。染料の hue をわずかに含ませて、地と同じ空気にする。 */
|
|
88
|
+
const primaryFgFor = (hue, scheme) => scheme === "light" ? oklch(98.5, .004, hue) : oklch(18, .02, hue);
|
|
89
|
+
/**
|
|
90
|
+
* 定義とトーンから実際の CSS 値を組み立てる。
|
|
91
|
+
* テストが不正な色を作って検査を確かめるのにも使う(AC-03-4 相当)。
|
|
92
|
+
*/
|
|
93
|
+
function buildColorEntry(def, tone = TACTILE_TONE) {
|
|
94
|
+
return {
|
|
95
|
+
...def,
|
|
96
|
+
light: {
|
|
97
|
+
primary: oklch(tone.light.l, def.fixedC ?? tone.light.c, def.hue),
|
|
98
|
+
primaryFg: primaryFgFor(def.hue, "light")
|
|
99
|
+
},
|
|
100
|
+
dark: {
|
|
101
|
+
primary: oklch(tone.dark.l, def.fixedCDark ?? tone.dark.c, def.hue),
|
|
102
|
+
primaryFg: primaryFgFor(def.hue, "dark")
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/** Textile Dyes の全8色(事前計算済み) */
|
|
107
|
+
const TACTILE_COLOR_SET = COLOR_DEFS.map((def) => buildColorEntry(def));
|
|
108
|
+
//#endregion
|
|
109
|
+
export { DEFAULT_COLOR_ID, TACTILE_COLOR_SET, TACTILE_TONE, buildColorEntry };
|
|
110
|
+
|
|
111
|
+
//# sourceMappingURL=color-set.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-set.mjs","names":[],"sources":["../../src/tokens/color-set.ts"],"sourcesContent":["/**\n * Tactile のカラーセット「Textile Dyes」とトーン。\n *\n * **specs/06-tones-and-colors が唯一の真実**で、ここはその写し。\n * 構造は Raster の `color-set.ts` と同じだが、値は独立している(ADR-C01):\n * トーンは明るく淡く(L54/C0.080)、色は染料の名を持ち、hue は Raster と1つも重ならない。\n *\n * Raster との最大の違いは **`neutralsFollowHue`**。Tactile は染まる生地なので、\n * 中立色まで選んだ染料の hue を帯びる(FR-06)。Raster は染まらない紙で chroma 0 のまま。\n */\n\nexport interface TactileTone {\n /** OKLCH の L(% 単位の数値。54 = 54%) */\n l: number\n /** OKLCH の C */\n c: number\n}\n\n/**\n * Textile Dyes のトーン。\n *\n * light の L50 は掃引で決めた値。**律速は常に Peacock を `subtle` 面に置いたとき**で、\n * L52 では余裕が 0.1 を切り、L54 以上はどの C でも 4.5:1 に届かない。\n * L50 なら 4.93 で、丸めや将来の微調整に耐える余裕が残る。\n * Raster(L44)との差は 6 ポイントで、トーンはモデルの識別子として機能する。\n */\nexport const TACTILE_TONE: { light: TactileTone; dark: TactileTone } = {\n light: { l: 50, c: 0.08 },\n dark: { l: 76, c: 0.075 },\n}\n\nexport interface TactileColorDef {\n /** `data-novi-color` に指定する名前(kebab-case) */\n id: string\n /** 表示名 */\n name: string\n /** OKLCH の hue(度) */\n hue: number\n /** バイカラーの相方。`--novi-color-secondary` にこの色の値が入る */\n pair: string\n /** 1行の出自。docs / llms / MCP が使う */\n description: string\n /** 無彩枠だけが持つ C の例外値(light) */\n fixedC?: number\n /** 同・dark */\n fixedCDark?: number\n}\n\n/**\n * 8色。全色が布を染めてきた染料の実名を持つ。\n * 紫・青緑・ピンクは Raster に無く、ここにある。入れる色と入れない色でモデルの性格を作る。\n */\nconst COLOR_DEFS: readonly TactileColorDef[] = [\n {\n id: 'indigo',\n name: 'Indigo',\n hue: 255,\n pair: 'saffron',\n description: '藍。デニムを染めた染料。既定色',\n },\n {\n id: 'peacock',\n name: 'Peacock',\n hue: 200,\n pair: 'madder',\n description: '孔雀の青緑。羽の見る角度の色',\n },\n {\n id: 'sage',\n name: 'Sage',\n hue: 148,\n pair: 'cochineal',\n description: 'セージの葉。くすみグリーンの定番',\n },\n {\n id: 'saffron',\n name: 'Saffron',\n hue: 78,\n pair: 'indigo',\n description: 'サフラン。染料にも香辛料にもなる黄',\n },\n {\n id: 'madder',\n name: 'Madder',\n hue: 28,\n pair: 'peacock',\n description: '茜。人類最古級の赤い染料',\n },\n {\n id: 'cochineal',\n name: 'Cochineal',\n hue: 5,\n pair: 'sage',\n description: 'コチニール。紅を生む染料',\n },\n {\n id: 'mauve',\n name: 'Mauve',\n hue: 315,\n pair: 'sage',\n description: 'モーブ。1856年、史上初の合成染料',\n },\n {\n id: 'greige',\n name: 'Greige',\n hue: 80,\n pair: 'indigo',\n description: '生機。染める前の布の色。無彩枠',\n fixedC: 0.022,\n fixedCDark: 0.018,\n },\n]\n\n/** `data-novi-color` 未指定・未知の名前のときに効く色(FR-05) */\nexport const DEFAULT_COLOR_ID = 'indigo'\n\n/**\n * OKLCH → 線形 sRGB。\n * 生成器(Node 実行)からも呼ぶため、依存なしで持つ(Raster と同じ理由)。\n */\nfunction toLinearSrgb(l: number, c: number, hue: number): [number, number, number] {\n const rad = (hue * Math.PI) / 180\n const a = c * Math.cos(rad)\n const b = c * Math.sin(rad)\n\n const lc = (l + 0.3963377774 * a + 0.2158037573 * b) ** 3\n const mc = (l - 0.1055613458 * a - 0.0638541728 * b) ** 3\n const sc = (l - 0.0894841775 * a - 1.291485548 * b) ** 3\n\n return [\n 4.0767416621 * lc - 3.3077115913 * mc + 0.2309699292 * sc,\n -1.2684380046 * lc + 2.6097574011 * mc - 0.3413193965 * sc,\n -0.0041960863 * lc - 0.7034186147 * mc + 1.707614701 * sc,\n ]\n}\n\n/** その OKLCH が sRGB で再現できるか。トーンの天井はコントラストではなくこれが決める。 */\nexport function inSrgbGamut(l: number, c: number, hue: number): boolean {\n const tolerance = 0.0005\n return toLinearSrgb(l, c, hue).every((v) => v >= -tolerance && v <= 1 + tolerance)\n}\n\n/**\n * 染まる中立色の配合(FR-06)。\n *\n * L は固定で、chroma と hue だけが染料に従う。`--novi-color-*` の全中立トークンを\n * この表から生成するため、色を選ぶと地の色ごと変わる。\n * chroma は 0.004〜0.02 の帯域に収める(ADR-T6)。\n */\nconst NEUTRAL_RECIPE = {\n light: {\n bg: { l: 97.6, c: 0.006 },\n subtle: { l: 94.5, c: 0.009 },\n fg: { l: 22, c: 0.015 },\n muted: { l: 47, c: 0.012 },\n border: { l: 90, c: 0.011 },\n 'border-strong': { l: 63, c: 0.013 },\n default: { l: 94.5, c: 0.009 },\n 'default-fg': { l: 22, c: 0.015 },\n },\n // dark は「持ち上がるほど明るい」。bg < subtle < surface の順を崩さないこと\n dark: {\n bg: { l: 14, c: 0.012 },\n subtle: { l: 20, c: 0.014 },\n fg: { l: 94, c: 0.008 },\n muted: { l: 70, c: 0.012 },\n border: { l: 30, c: 0.015 },\n 'border-strong': { l: 55, c: 0.014 },\n default: { l: 20, c: 0.014 },\n 'default-fg': { l: 94, c: 0.008 },\n },\n} as const\n\n/** 浮く面(シート・メニュー)の色。地より明るくして「持ち上がり」を作る(AC-06-3)。 */\nconst SURFACE_RECIPE = {\n light: { l: 99.3, c: 0.004 },\n // dark で 24% なのは bg(14%) との背景色差 1.2:1 を満たす下限。\n // 暗所では影がほとんど見えないため、浮きは明度差で伝えるしかない(AC-06-3)\n dark: { l: 24, c: 0.014 },\n} as const\n\nexport type Scheme = 'light' | 'dark'\n\nconst oklch = (l: number, c: number, hue: number) => `oklch(${l}% ${c} ${hue})`\n\n/** その染料で染めた中立色一式を作る。 */\nexport function neutralsFor(hue: number, scheme: Scheme): Record<string, string> {\n const recipe = NEUTRAL_RECIPE[scheme]\n const out: Record<string, string> = {}\n for (const [name, { l, c }] of Object.entries(recipe)) {\n out[name] = oklch(l, c, hue)\n }\n // overlay は背景を覆う暗幕。alpha を持つため個別に組む\n out.overlay = scheme === 'light' ? `oklch(20% 0.01 ${hue} / 0.45)` : `oklch(8% 0.01 ${hue} / 0.6)`\n return out\n}\n\n/** 浮く面の色。`--novi-color-surface` として出力する。 */\nexport function surfaceFor(hue: number, scheme: Scheme): string {\n const { l, c } = SURFACE_RECIPE[scheme]\n return oklch(l, c, hue)\n}\n\nexport interface TactileColorSchemeValues {\n primary: string\n primaryFg: string\n}\n\nexport interface TactileColorEntry extends TactileColorDef {\n light: TactileColorSchemeValues\n dark: TactileColorSchemeValues\n}\n\n/** primary の面に乗る文字。染料の hue をわずかに含ませて、地と同じ空気にする。 */\nconst primaryFgFor = (hue: number, scheme: Scheme) =>\n scheme === 'light' ? oklch(98.5, 0.004, hue) : oklch(18, 0.02, hue)\n\n/**\n * 定義とトーンから実際の CSS 値を組み立てる。\n * テストが不正な色を作って検査を確かめるのにも使う(AC-03-4 相当)。\n */\nexport function buildColorEntry(\n def: TactileColorDef,\n tone: { light: TactileTone; dark: TactileTone } = TACTILE_TONE,\n): TactileColorEntry {\n return {\n ...def,\n light: {\n primary: oklch(tone.light.l, def.fixedC ?? tone.light.c, def.hue),\n primaryFg: primaryFgFor(def.hue, 'light'),\n },\n dark: {\n primary: oklch(tone.dark.l, def.fixedCDark ?? tone.dark.c, def.hue),\n primaryFg: primaryFgFor(def.hue, 'dark'),\n },\n }\n}\n\n/** Textile Dyes の全8色(事前計算済み) */\nexport const TACTILE_COLOR_SET: readonly TactileColorEntry[] = COLOR_DEFS.map((def) =>\n buildColorEntry(def),\n)\n\n/** @throws セットに無い id(相方の参照ミスは実行時ではなくここで死ぬべき) */\nexport function colorById(id: string): TactileColorEntry {\n const entry = TACTILE_COLOR_SET.find((c) => c.id === id)\n if (entry === undefined) throw new Error(`Textile Dyes に無い色です: ${id}`)\n return entry\n}\n"],"mappings":";;;;;;;;;AA0BA,MAAa,eAA0D;CACrE,OAAO;EAAE,GAAG;EAAI,GAAG;CAAK;CACxB,MAAM;EAAE,GAAG;EAAI,GAAG;CAAM;AAC1B;;;;;AAuBA,MAAM,aAAyC;CAC7C;EACE,IAAI;EACJ,MAAM;EACN,KAAK;EACL,MAAM;EACN,aAAa;CACf;CACA;EACE,IAAI;EACJ,MAAM;EACN,KAAK;EACL,MAAM;EACN,aAAa;CACf;CACA;EACE,IAAI;EACJ,MAAM;EACN,KAAK;EACL,MAAM;EACN,aAAa;CACf;CACA;EACE,IAAI;EACJ,MAAM;EACN,KAAK;EACL,MAAM;EACN,aAAa;CACf;CACA;EACE,IAAI;EACJ,MAAM;EACN,KAAK;EACL,MAAM;EACN,aAAa;CACf;CACA;EACE,IAAI;EACJ,MAAM;EACN,KAAK;EACL,MAAM;EACN,aAAa;CACf;CACA;EACE,IAAI;EACJ,MAAM;EACN,KAAK;EACL,MAAM;EACN,aAAa;CACf;CACA;EACE,IAAI;EACJ,MAAM;EACN,KAAK;EACL,MAAM;EACN,aAAa;EACb,QAAQ;EACR,YAAY;CACd;AACF;;AAGA,MAAa,mBAAmB;AAqEhC,MAAM,SAAS,GAAW,GAAW,QAAgB,SAAS,EAAE,IAAI,EAAE,GAAG,IAAI;;AA+B7E,MAAM,gBAAgB,KAAa,WACjC,WAAW,UAAU,MAAM,MAAM,MAAO,GAAG,IAAI,MAAM,IAAI,KAAM,GAAG;;;;;AAMpE,SAAgB,gBACd,KACA,OAAkD,cAC/B;CACnB,OAAO;EACL,GAAG;EACH,OAAO;GACL,SAAS,MAAM,KAAK,MAAM,GAAG,IAAI,UAAU,KAAK,MAAM,GAAG,IAAI,GAAG;GAChE,WAAW,aAAa,IAAI,KAAK,OAAO;EAC1C;EACA,MAAM;GACJ,SAAS,MAAM,KAAK,KAAK,GAAG,IAAI,cAAc,KAAK,KAAK,GAAG,IAAI,GAAG;GAClE,WAAW,aAAa,IAAI,KAAK,MAAM;EACzC;CACF;AACF;;AAGA,MAAa,oBAAkD,WAAW,KAAK,QAC7E,gBAAgB,GAAG,CACrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novi-ui/tactile",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Novi UI theme 2 — touch-first. Bottom sheets, generous tap targets, soft elevation.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"tailwind-variants": "^3.3.1",
|
|
35
|
-
"@novi-ui/core": "0.
|
|
35
|
+
"@novi-ui/core": "0.2.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@size-limit/preset-small-lib": "^13.0.3",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"tsdown": "0.22.14",
|
|
53
53
|
"typescript": "6.0.3",
|
|
54
54
|
"vitest": "4.1.11",
|
|
55
|
-
"@novi-ui/raster": "0.
|
|
55
|
+
"@novi-ui/raster": "0.4.0"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsdown && node scripts/generate-theme-css.mjs",
|