@serendie/ui 2.5.0 → 2.5.1-dev.202602170627
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -8
- package/dist/client.js +135 -119
- package/dist/components/Avatar/Avatar.js +3 -3
- package/dist/components/Badge/Badge.d.ts +6 -6
- package/dist/components/Badge/Badge.js +21 -21
- package/dist/components/Banner/Banner.d.ts +1 -4
- package/dist/components/Banner/Banner.js +8 -11
- package/dist/components/Button/Button.d.ts +0 -2
- package/dist/components/Button/Button.js +10 -11
- package/dist/components/CheckBox/CheckBox.js +4 -4
- package/dist/components/DatePicker/styles.js +1 -1
- package/dist/components/Divider/Divider.d.ts +2 -2
- package/dist/components/Divider/Divider.js +11 -11
- package/dist/components/Drawer/Drawer.js +3 -3
- package/dist/components/DropdownMenu/DropdownMenu.js +5 -5
- package/dist/components/IconButton/IconButton.d.ts +0 -1
- package/dist/components/IconButton/IconButton.js +0 -1
- package/dist/components/ModalDialog/ModalDialog.js +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.js +9 -9
- package/dist/components/Search/Search.js +5 -5
- package/dist/components/Select/Select.js +14 -14
- package/dist/components/Switch/Switch.js +5 -5
- package/dist/components/TextField/TextField.js +52 -48
- package/dist/components/Toast/Toast.d.ts +3 -5
- package/dist/components/Toast/Toast.js +8 -10
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/provider.d.ts +29 -4
- package/dist/i18n/provider.js +31 -11
- package/dist/index.d.ts +2 -0
- package/dist/index.js +135 -119
- package/dist/node_modules/@serendie/design-token/dist/panda-tokens.js +310 -0
- package/dist/node_modules/@serendie/design-token/dist/tokens.js +126 -0
- package/dist/preset.d.ts +0 -930
- package/dist/styled-system/css/conditions.js +1 -1
- package/dist/styled-system/jsx/is-valid-prop.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme/ThemeContext.d.ts +55 -0
- package/dist/theme/ThemeContext.js +15 -0
- package/dist/theme/index.d.ts +3 -0
- package/dist/theme/index.js +11 -0
- package/dist/theme/initColorScheme.d.ts +74 -0
- package/dist/theme/initColorScheme.js +32 -0
- package/dist/theme/useSystemColorScheme.d.ts +15 -0
- package/dist/theme/useSystemColorScheme.js +19 -0
- package/dist/tokens/getToken.d.ts +0 -378
- package/dist/tokens/index.d.ts +0 -930
- package/package.json +2 -2
- package/styled-system/css/conditions.js +1 -1
- package/styled-system/jsx/is-valid-prop.js +1 -1
- package/styled-system/themes/index.d.ts +6 -1
- package/styled-system/themes/theme-konjo-dark.json +5 -0
- package/styled-system/types/conditions.d.ts +2 -0
package/dist/i18n/provider.d.ts
CHANGED
|
@@ -1,13 +1,38 @@
|
|
|
1
|
+
import { ColorMode, ColorTheme } from '../theme/ThemeContext';
|
|
1
2
|
export type Language = "ja" | "en";
|
|
2
3
|
export declare const LanguageContext: import('react').Context<Language | undefined>;
|
|
4
|
+
export interface SerendieProviderProps {
|
|
5
|
+
/** 言語設定 */
|
|
6
|
+
lang: Language;
|
|
7
|
+
/** カラーテーマ(デフォルト: 'konjo') */
|
|
8
|
+
colorTheme?: ColorTheme;
|
|
9
|
+
/** カラーモード(デフォルト: undefined = ライトモード) */
|
|
10
|
+
colorMode?: ColorMode;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
3
13
|
/**
|
|
4
14
|
* Serendie UIの設定を提供するProvider
|
|
5
15
|
* アプリケーションのルートで使用してください
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* // 基本的な使い方(言語のみ)
|
|
20
|
+
* <SerendieProvider lang="ja">
|
|
21
|
+
* <App />
|
|
22
|
+
* </SerendieProvider>
|
|
23
|
+
*
|
|
24
|
+
* // カラーモードを指定(OSの設定に従う)
|
|
25
|
+
* <SerendieProvider lang="ja" colorMode="system">
|
|
26
|
+
* <App />
|
|
27
|
+
* </SerendieProvider>
|
|
28
|
+
*
|
|
29
|
+
* // カラーテーマとモードを指定
|
|
30
|
+
* <SerendieProvider lang="ja" colorTheme="asagi" colorMode="system">
|
|
31
|
+
* <App />
|
|
32
|
+
* </SerendieProvider>
|
|
33
|
+
* ```
|
|
6
34
|
*/
|
|
7
|
-
export declare function SerendieProvider({ lang, children, }:
|
|
8
|
-
lang: Language;
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare function SerendieProvider({ lang, colorTheme, colorMode, children, }: SerendieProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
36
|
/**
|
|
12
37
|
* @deprecated LanguageProvider は SerendieProvider にリネームされました
|
|
13
38
|
*/
|
package/dist/i18n/provider.js
CHANGED
|
@@ -1,15 +1,35 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as m, useEffect as u, createContext as f } from "react";
|
|
3
|
+
import { resolveTheme as c, ThemeContext as v } from "../theme/ThemeContext.js";
|
|
4
|
+
import { useSystemColorScheme as h } from "../theme/useSystemColorScheme.js";
|
|
5
|
+
const l = f(void 0);
|
|
6
|
+
function p({
|
|
7
|
+
lang: d,
|
|
8
|
+
colorTheme: t = "konjo",
|
|
9
|
+
colorMode: o,
|
|
10
|
+
children: i
|
|
7
11
|
}) {
|
|
8
|
-
|
|
12
|
+
const r = h() === "dark", e = m(() => c(t, o ?? "light", r), [t, o, r]);
|
|
13
|
+
u(() => {
|
|
14
|
+
if (typeof document > "u") return;
|
|
15
|
+
const n = document.documentElement;
|
|
16
|
+
return e ? n.dataset.pandaTheme = e : delete n.dataset.pandaTheme, () => {
|
|
17
|
+
};
|
|
18
|
+
}, [e]);
|
|
19
|
+
const a = m(
|
|
20
|
+
() => ({
|
|
21
|
+
colorTheme: t,
|
|
22
|
+
colorMode: o ?? "light",
|
|
23
|
+
resolvedTheme: e,
|
|
24
|
+
systemPrefersDark: r
|
|
25
|
+
}),
|
|
26
|
+
[t, o, e, r]
|
|
27
|
+
);
|
|
28
|
+
return /* @__PURE__ */ s(l.Provider, { value: d, children: /* @__PURE__ */ s(v.Provider, { value: a, children: i }) });
|
|
9
29
|
}
|
|
10
|
-
const
|
|
30
|
+
const S = p;
|
|
11
31
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
32
|
+
l as LanguageContext,
|
|
33
|
+
S as LanguageProvider,
|
|
34
|
+
p as SerendieProvider
|
|
15
35
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { SerendiePreset } from './preset';
|
|
2
|
+
export { ThemeContext, useThemeContext, useSystemColorScheme, resolveTheme, getColorSchemeScript, ColorSchemeScript, type ColorMode, type ColorTheme, type ThemeContextValue, type ColorSchemeScriptOptions, } from './theme/index';
|
|
3
|
+
export { SerendieProvider, LanguageProvider, useTranslations, getTranslations, formatDateByLang, type Language, type SerendieProviderProps, } from './i18n/index';
|
|
2
4
|
export * from './components/Accordion/index.ts';
|
|
3
5
|
export * from './components/Avatar/index.ts';
|
|
4
6
|
export * from './components/Badge/index.ts';
|
package/dist/index.js
CHANGED
|
@@ -1,121 +1,137 @@
|
|
|
1
|
-
import { SerendiePreset as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
1
|
+
import { SerendiePreset as r } from "./preset.js";
|
|
2
|
+
import { ThemeContext as a, resolveTheme as m, useThemeContext as p } from "./theme/ThemeContext.js";
|
|
3
|
+
import { useSystemColorScheme as i } from "./theme/useSystemColorScheme.js";
|
|
4
|
+
import { ColorSchemeScript as s, getColorSchemeScript as f } from "./theme/initColorScheme.js";
|
|
5
|
+
import { formatDateByLang as l, getTranslations as d, useTranslations as h } from "./i18n/index.js";
|
|
6
|
+
import { Accordion as C } from "./components/Accordion/Accordion.js";
|
|
7
|
+
import { AccordionGroup as B } from "./components/Accordion/AccordionGroup.js";
|
|
8
|
+
import { Avatar as y, AvatarStyle as T } from "./components/Avatar/Avatar.js";
|
|
9
|
+
import { Badge as P, BadgeCloseButton as D, BadgeStyle as b } from "./components/Badge/Badge.js";
|
|
10
|
+
import { Banner as v } from "./components/Banner/Banner.js";
|
|
11
|
+
import { BottomNavigation as w } from "./components/BottomNavigation/BottomNavigation.js";
|
|
12
|
+
import { BottomNavigationItem as L, BottomNavigationItemStyle as N } from "./components/BottomNavigation/BottomNavigationItem.js";
|
|
13
|
+
import { Button as F, ButtonStyle as G } from "./components/Button/Button.js";
|
|
14
|
+
import { SerendieChartTheme as W } from "./components/Chart/SerendieChartTheme.js";
|
|
15
|
+
import { compactChartMargin as q, defaultChartMargin as z, getChartColor as E, getChartColors as H, legendChartMargin as J, spaciousChartMargin as K, useBarChartProps as O, useChartProps as Q, useLineChartProps as V, usePieChartProps as X } from "./components/Chart/SerendieChartProps.js";
|
|
16
|
+
import { CheckBox as Z, CheckBoxStyle as _, checkboxCheckedIconCss as $, checkboxIconCss as oo, checkboxUncheckedIconCss as eo } from "./components/CheckBox/CheckBox.js";
|
|
17
|
+
import { ChoiceBox as to, ChoiceBoxStyle as ao } from "./components/ChoiceBox/ChoiceBox.js";
|
|
18
|
+
import { DashboardWidget as po } from "./components/DashboardWidget/DashboardWidget.js";
|
|
19
|
+
import { DataTable as io } from "./components/DataTable/index.js";
|
|
20
|
+
import { DatePicker as so } from "./components/DatePicker/DatePicker.js";
|
|
21
|
+
import { Divider as co, DividerStyle as lo } from "./components/Divider/Divider.js";
|
|
22
|
+
import { Drawer as So } from "./components/Drawer/Drawer.js";
|
|
23
|
+
import { DropdownMenu as go, DropdownMenuStyle as Bo } from "./components/DropdownMenu/DropdownMenu.js";
|
|
24
|
+
import { IconButton as yo, IconButtonStyle as To } from "./components/IconButton/IconButton.js";
|
|
25
|
+
import { List as Po } from "./components/List/List.js";
|
|
26
|
+
import { ListItem as bo, ListItemStyle as ko } from "./components/List/ListItem.js";
|
|
27
|
+
import { ModalDialog as Mo } from "./components/ModalDialog/ModalDialog.js";
|
|
28
|
+
import { NotificationBadge as Ao } from "./components/NotificationBadge/NotificationBadge.js";
|
|
29
|
+
import { Pagination as No, PaginationStyle as Ro } from "./components/Pagination/Pagination.js";
|
|
30
|
+
import { PasswordField as Go } from "./components/PasswordField/PasswordField.js";
|
|
31
|
+
import { ProgressIndicator as Wo } from "./components/ProgressIndicator/ProgressIndicator.js";
|
|
32
|
+
import { ProgressIndicatorIndeterminate as qo } from "./components/ProgressIndicator/ProgressIndicatorIndeterminate.js";
|
|
33
|
+
import { RadioButton as Eo, RadioButtonStyle as Ho, radioCheckedIconCss as Jo, radioIconCss as Ko, radioUncheckedIconCss as Oo } from "./components/RadioButton/RadioButton.js";
|
|
34
|
+
import { RadioGroup as Vo } from "./components/RadioButton/RadioGroup.js";
|
|
35
|
+
import { Search as Yo, SearchStyle as Zo } from "./components/Search/Search.js";
|
|
36
|
+
import { Select as $o, SelectStyle as oe } from "./components/Select/Select.js";
|
|
37
|
+
import { Switch as re, SwitchStyle as te } from "./components/Switch/Switch.js";
|
|
38
|
+
import { Tabs as me, TabsStyle as pe } from "./components/Tabs/Tabs.js";
|
|
39
|
+
import { TabItem as ie, TabItemStyle as ne } from "./components/Tabs/TabItem.js";
|
|
40
|
+
import { TextArea as fe } from "./components/TextArea/TextArea.js";
|
|
41
|
+
import { TextField as le } from "./components/TextField/TextField.js";
|
|
42
|
+
import { Toast as he, ToastStyle as Se, toaster as Ce } from "./components/Toast/Toast.js";
|
|
43
|
+
import { Tooltip as Be } from "./components/Tooltip/Tooltip.js";
|
|
44
|
+
import { TopAppBar as ye } from "./components/TopAppBar/TopAppBar.js";
|
|
45
|
+
import { LanguageProvider as Ie, SerendieProvider as Pe } from "./i18n/provider.js";
|
|
46
|
+
import { DataTableComponent as be } from "./components/DataTable/DataTableComponent.js";
|
|
47
|
+
import { parse as ve } from "./node_modules/@zag-js/date-picker/dist/index.js";
|
|
43
48
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
49
|
+
C as Accordion,
|
|
50
|
+
B as AccordionGroup,
|
|
51
|
+
y as Avatar,
|
|
52
|
+
T as AvatarStyle,
|
|
53
|
+
P as Badge,
|
|
54
|
+
D as BadgeCloseButton,
|
|
55
|
+
b as BadgeStyle,
|
|
56
|
+
v as Banner,
|
|
57
|
+
w as BottomNavigation,
|
|
58
|
+
L as BottomNavigationItem,
|
|
59
|
+
N as BottomNavigationItemStyle,
|
|
60
|
+
F as Button,
|
|
61
|
+
G as ButtonStyle,
|
|
62
|
+
Z as CheckBox,
|
|
63
|
+
_ as CheckBoxStyle,
|
|
64
|
+
to as ChoiceBox,
|
|
65
|
+
ao as ChoiceBoxStyle,
|
|
66
|
+
s as ColorSchemeScript,
|
|
67
|
+
po as DashboardWidget,
|
|
68
|
+
io as DataTable,
|
|
69
|
+
be as DataTableComponent,
|
|
70
|
+
so as DatePicker,
|
|
71
|
+
co as Divider,
|
|
72
|
+
lo as DividerStyle,
|
|
73
|
+
So as Drawer,
|
|
74
|
+
go as DropdownMenu,
|
|
75
|
+
Bo as DropdownMenuStyle,
|
|
76
|
+
yo as IconButton,
|
|
77
|
+
To as IconButtonStyle,
|
|
78
|
+
Ie as LanguageProvider,
|
|
79
|
+
Po as List,
|
|
80
|
+
bo as ListItem,
|
|
81
|
+
ko as ListItemStyle,
|
|
82
|
+
Mo as ModalDialog,
|
|
83
|
+
Ao as NotificationBadge,
|
|
84
|
+
No as Pagination,
|
|
85
|
+
Ro as PaginationStyle,
|
|
86
|
+
Go as PasswordField,
|
|
87
|
+
Wo as ProgressIndicator,
|
|
88
|
+
qo as ProgressIndicatorIndeterminate,
|
|
89
|
+
Eo as RadioButton,
|
|
90
|
+
Ho as RadioButtonStyle,
|
|
91
|
+
Vo as RadioGroup,
|
|
92
|
+
Yo as Search,
|
|
93
|
+
Zo as SearchStyle,
|
|
94
|
+
$o as Select,
|
|
95
|
+
oe as SelectStyle,
|
|
96
|
+
W as SerendieChartTheme,
|
|
97
|
+
r as SerendiePreset,
|
|
98
|
+
Pe as SerendieProvider,
|
|
99
|
+
re as Switch,
|
|
100
|
+
te as SwitchStyle,
|
|
101
|
+
ie as TabItem,
|
|
102
|
+
ne as TabItemStyle,
|
|
103
|
+
me as Tabs,
|
|
104
|
+
pe as TabsStyle,
|
|
105
|
+
fe as TextArea,
|
|
106
|
+
le as TextField,
|
|
107
|
+
a as ThemeContext,
|
|
108
|
+
he as Toast,
|
|
109
|
+
Se as ToastStyle,
|
|
110
|
+
Be as Tooltip,
|
|
111
|
+
ye as TopAppBar,
|
|
112
|
+
$ as checkboxCheckedIconCss,
|
|
113
|
+
oo as checkboxIconCss,
|
|
114
|
+
eo as checkboxUncheckedIconCss,
|
|
115
|
+
q as compactChartMargin,
|
|
116
|
+
z as defaultChartMargin,
|
|
117
|
+
l as formatDateByLang,
|
|
118
|
+
E as getChartColor,
|
|
119
|
+
H as getChartColors,
|
|
120
|
+
f as getColorSchemeScript,
|
|
121
|
+
d as getTranslations,
|
|
122
|
+
J as legendChartMargin,
|
|
123
|
+
ve as parseDate,
|
|
124
|
+
Jo as radioCheckedIconCss,
|
|
125
|
+
Ko as radioIconCss,
|
|
126
|
+
Oo as radioUncheckedIconCss,
|
|
127
|
+
m as resolveTheme,
|
|
128
|
+
K as spaciousChartMargin,
|
|
129
|
+
Ce as toaster,
|
|
130
|
+
O as useBarChartProps,
|
|
131
|
+
Q as useChartProps,
|
|
132
|
+
V as useLineChartProps,
|
|
133
|
+
X as usePieChartProps,
|
|
134
|
+
i as useSystemColorScheme,
|
|
135
|
+
p as useThemeContext,
|
|
136
|
+
h as useTranslations
|
|
121
137
|
};
|