dozy 1.0.21 → 1.0.22

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.
@@ -0,0 +1,110 @@
1
+ @import './cover.css';
2
+
3
+ @import 'tw-animate-css';
4
+
5
+ @custom-variant dark (&:is(.dark *));
6
+
7
+ :root {
8
+ /* ============================================================
9
+ 🔗 2. Shadcn 映射区 (无需改动,自动联动)
10
+ ============================================================ */
11
+ --radius: 0.625rem;
12
+
13
+ --background: var(--xai-primary-light);
14
+ --foreground: var(--xai-text);
15
+
16
+ --card: var(--xai-primary-light);
17
+ --card-foreground: var(--xai-text);
18
+
19
+ --popover: var(--xai-primary-light);
20
+ --popover-foreground: var(--xai-text);
21
+
22
+ /* Shadcn 的 Primary 其实是你的 Notable 显眼色 */
23
+ --primary: var(--xai-notable);
24
+ --primary-foreground: var(--xai-primary-light);
25
+
26
+ --secondary: var(--xai-primary);
27
+ --secondary-foreground: var(--xai-text);
28
+
29
+ --muted: var(--xai-primary-dark);
30
+ --muted-foreground: var(--xai-text-muted);
31
+
32
+ --accent: var(--xai-primary);
33
+ --accent-foreground: var(--xai-text);
34
+
35
+ --destructive: var(--xai-destructive);
36
+ --destructive-foreground: oklch(0.985 0 0);
37
+
38
+ --border: var(--xai-border);
39
+ --input: var(--xai-border);
40
+ --ring: var(--xai-notable);
41
+
42
+ /* 图表颜色默认根据 Notable 进行色相偏移,建议手动微调或保留默认 */
43
+ --chart-1: var(--xai-notable);
44
+ --chart-2: oklch(0.6 0.118 184.704);
45
+ --chart-3: oklch(0.398 0.07 227.392);
46
+ --chart-4: oklch(0.828 0.189 84.429);
47
+ --chart-5: oklch(0.769 0.188 70.08);
48
+
49
+ --sidebar: var(--xai-primary-dark);
50
+ --sidebar-foreground: var(--xai-text);
51
+ --sidebar-primary: var(--xai-notable);
52
+ --sidebar-primary-foreground: var(--xai-primary-dark);
53
+ --sidebar-accent: var(--xai-primary-light);
54
+ --sidebar-accent-foreground: var(--xai-text);
55
+ --sidebar-border: var(--xai-border);
56
+ --sidebar-ring: var(--xai-notable);
57
+ }
58
+
59
+ @layer base {
60
+ * {
61
+ @apply border-border outline-ring/50;
62
+ }
63
+ body {
64
+ @apply bg-[#bdd] text-foreground;
65
+ }
66
+ }
67
+
68
+ @theme inline {
69
+ /* 半径保持联动 */
70
+ --radius-sm: calc(var(--radius) - 4px);
71
+ --radius-md: calc(var(--radius) - 2px);
72
+ --radius-lg: var(--radius);
73
+ --radius-xl: calc(var(--radius) + 4px);
74
+ --radius-2xl: calc(var(--radius) + 8px);
75
+ --radius-3xl: calc(var(--radius) + 12px);
76
+ --radius-4xl: calc(var(--radius) + 16px);
77
+
78
+ /* 颜色变量保持联动 */
79
+ --color-background: var(--background);
80
+ --color-foreground: var(--foreground);
81
+ --color-card: var(--card);
82
+ --color-card-foreground: var(--card-foreground);
83
+ --color-popover: var(--popover);
84
+ --color-popover-foreground: var(--popover-foreground);
85
+ --color-primary: var(--primary);
86
+ --color-primary-foreground: var(--primary-foreground);
87
+ --color-secondary: var(--secondary);
88
+ --color-secondary-foreground: var(--secondary-foreground);
89
+ --color-muted: var(--muted);
90
+ --color-muted-foreground: var(--muted-foreground);
91
+ --color-accent: var(--accent);
92
+ --color-accent-foreground: var(--accent-foreground);
93
+ --color-destructive: var(--destructive);
94
+ --color-border: var(--border);
95
+ --color-input: var(--input);
96
+ --color-ring: var(--ring);
97
+ --color-chart-1: var(--chart-1);
98
+ --color-chart-2: var(--chart-2);
99
+ --color-chart-3: var(--chart-3);
100
+ --color-chart-4: var(--chart-4);
101
+ --color-chart-5: var(--chart-5);
102
+ --color-sidebar: var(--sidebar);
103
+ --color-sidebar-foreground: var(--sidebar-foreground);
104
+ --color-sidebar-primary: var(--sidebar-primary);
105
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
106
+ --color-sidebar-accent: var(--sidebar-accent);
107
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
108
+ --color-sidebar-border: var(--sidebar-border);
109
+ --color-sidebar-ring: var(--sidebar-ring);
110
+ }
@@ -1,4 +1,4 @@
1
- /* 自己去设置滚动吧 */
1
+ /* 要显示滚动条需要加 scrollbar 类样式 */
2
2
  /* =========================================
3
3
  CSS Reset and Global Styles
4
4
  Project: xaidozy
@@ -9,7 +9,8 @@
9
9
  ======================= */
10
10
  @font-face {
11
11
  font-family: 'xaifont';
12
- src: url('/fonts/xaifont.woff2') format('woff2'),
12
+ src:
13
+ url('/fonts/xaifont.woff2') format('woff2'),
13
14
  url('https://xaidozy.github.io/fonts/xaifont.woff2') format('woff2');
14
15
  font-display: swap;
15
16
  }
@@ -39,10 +40,11 @@
39
40
  box-sizing: border-box; /* 1 */
40
41
  margin: 0; /* 2 */
41
42
  padding: 0; /* 2 */
42
- border: 0 solid; /* 3 */
43
+ border-width: 0;
44
+ border-style: solid;
43
45
 
44
- font-family: inherit !important;
45
- font-size: inherit !important;
46
+ font-family: inherit;
47
+ font-size: inherit;
46
48
  }
47
49
 
48
50
  /* =======================
@@ -56,34 +58,40 @@
56
58
  -webkit-font-smoothing: antialiased; /* WebKit字体抗锯齿 */
57
59
  -moz-osx-font-smoothing: grayscale; /* Firefox字体抗锯齿 */
58
60
 
59
- --status-bar-height: 0;
61
+ --for-font:
62
+ xaifont, Inter, system-ui, Avenir, Helvetica, Arial, ui-sans-serif, 'Apple Color Emoji',
63
+ 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif;
64
+ --for-code-font:
65
+ ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
66
+ monospace;
60
67
  }
61
68
 
62
69
  /* HTML 基础设置
63
70
  1. 统一行高
64
71
  2. iOS 字体大小调整修正
65
72
  3. 设置更易读的 Tab 宽度
66
- 4. 默认无衬线字体栈
67
- 5. 禁用 iOS 点击高亮
73
+ 4. 禁用 iOS 点击高亮
68
74
  */
69
75
  html {
70
- font-size: 16px !important;
76
+ font-size: 16px;
71
77
  width: 100%;
72
78
  height: 100%;
73
79
  overflow-x: hidden;
74
80
  overflow-y: hidden; /* 防止 HTML 层滚动,通常由 Body 处理 */
75
81
 
76
82
  line-height: 1.5; /* 1 */
77
- -webkit-text-size-adjust: 100%; /* 2 */
83
+ -webkit-text-size-adjust: 100% !important;
84
+ -moz-text-size-adjust: 100% !important;
85
+ -ms-text-size-adjust: 100% !important;
86
+ text-size-adjust: 100% !important;
78
87
  tab-size: 4; /* 3 */
79
88
 
80
89
  /* 字体栈 */
81
- font-family: xaifont, Inter, system-ui, Avenir, Helvetica, Arial, ui-sans-serif,
82
- 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif !important; /* 4 */
90
+ font-family: var(--for-font);
83
91
 
84
92
  font-feature-settings: normal;
85
93
  font-variation-settings: normal;
86
- -webkit-tap-highlight-color: transparent; /* 5 */
94
+ -webkit-tap-highlight-color: transparent; /* 4 */
87
95
  }
88
96
 
89
97
  /* Body 基础设置 */
@@ -99,11 +107,9 @@ body {
99
107
  user-select: none;
100
108
 
101
109
  /* 背景设置 */
102
- color: #fff;
103
- background-color: #000;
104
110
  background-attachment: fixed;
105
111
  background-size: cover;
106
- background-blend-mode: hard-light;
112
+ /* background-blend-mode: hard-light; */
107
113
  }
108
114
 
109
115
  /* 根元素 */
@@ -115,7 +121,8 @@ body {
115
121
  *,
116
122
  *::before,
117
123
  *::after {
118
- text-shadow: 0 1px 1px #000;
124
+ /* text-shadow: 0 0.5px 0.5px color-mix(in srgb, currentColor, white 80%) !important; */
125
+ /* todos */
119
126
  user-select: inherit;
120
127
 
121
128
  /* 背景图默认行为 */
@@ -141,7 +148,11 @@ body {
141
148
  /* 选中态样式 */
142
149
  *::selection {
143
150
  background-color: #222;
144
- color: #fff;
151
+ color: #ddd;
152
+ }
153
+ .dark *::selection {
154
+ color: #222;
155
+ background-color: #ddd;
145
156
  }
146
157
 
147
158
  /* =======================
@@ -252,22 +263,22 @@ code,
252
263
  kbd,
253
264
  samp,
254
265
  pre {
255
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
256
- 'Courier New', monospace;
266
+ font-family: var(--for-code-font);
257
267
  font-feature-settings: normal;
258
268
  font-variation-settings: normal;
259
269
  font-size: 1em;
270
+ white-space: pre-wrap;
260
271
  }
261
272
 
262
273
  /* 小号字体 */
263
274
  small {
264
- font-size: 80%;
275
+ font-size: 0.8em;
265
276
  }
266
277
 
267
278
  /* 上标与下标 (防止影响行高) */
268
279
  sub,
269
280
  sup {
270
- font-size: 75%;
281
+ font-size: 0.75em;
271
282
  line-height: 0;
272
283
  position: relative;
273
284
  vertical-align: baseline;
@@ -323,7 +334,6 @@ table {
323
334
  ======================= */
324
335
 
325
336
  /* 基础行内块设定 */
326
- span,
327
337
  img {
328
338
  display: inline-block;
329
339
  }
@@ -0,0 +1,104 @@
1
+ /* @utility xbase {
2
+ } */
3
+
4
+ @utility xaibar {
5
+ @apply absolute w-full h-13;
6
+ @apply flex justify-evenly items-center border-t-1 border-b-1;
7
+ @apply backdrop-blur-xs bg-(--xai-primary-light)/40;
8
+ /* @apply shadow-[0_0_2px_1px_#0005]; */
9
+ @apply shadow-[0_0_2px_1px_color-mix(in_srgb,var(--xai-shadow),transparent_67%)];
10
+ }
11
+
12
+ @utility xshadow {
13
+ /* @apply shadow-[0_0_8px_0px_#0005,0_0_2px_0px_#000a]; */
14
+ @apply shadow-[0_0_8px_0px_color-mix(in_srgb,var(--xai-shadow),transparent_67%),0_0_2px_0px_color-mix(in_srgb,var(--xai-shadow),transparent_33%)];
15
+ }
16
+ @utility frame-bg {
17
+ /* @apply text-(--xai-text); */
18
+ @apply bg-(--xai-primary);
19
+ }
20
+ @utility shapee {
21
+ @apply px-2 py-1 rounded-md;
22
+ }
23
+
24
+ @utility tp-frame {
25
+ @apply xshadow;
26
+ @apply shapee;
27
+ }
28
+ @utility frame {
29
+ @apply frame-bg;
30
+ @apply xshadow;
31
+ @apply shapee;
32
+ }
33
+ @utility contained {
34
+ @apply frame-bg w-fit shapee;
35
+ }
36
+
37
+ /* @utility with-border {
38
+ @apply rounded-md border-1 border-(--xai-border);
39
+ } */
40
+
41
+ @utility border-frame {
42
+ @apply frame;
43
+ @apply border-1 border-(--xai-border);
44
+ }
45
+
46
+ @utility inlineb {
47
+ @apply mx-0.5;
48
+ @apply inline-block;
49
+ }
50
+
51
+ @utility scroller {
52
+ @apply overflow-y-scroll overflow-x-visible h-full;
53
+ }
54
+
55
+ @utility nowrap {
56
+ @apply whitespace-nowrap;
57
+ }
58
+
59
+ @utility even-wrapper {
60
+ @apply flex flex-row justify-evenly items-center;
61
+ }
62
+
63
+ @utility container {
64
+ @apply border-frame bg-(--xai-primary-light) px-5 py-3;
65
+ @apply rounded-2xl flex flex-col gap-1 overflow-hidden;
66
+ }
67
+
68
+ @utility container-with-header {
69
+ @apply container pt-0!;
70
+ & > *:first-child {
71
+ @apply text-center p-1 bg-(--xai-primary-dark);
72
+ @apply text-(--xai-primary-light) -mx-5 mb-2 border-b-1 border-(--xai-border);
73
+ }
74
+ }
75
+
76
+ @utility c-form {
77
+ @apply grid p-1 gap-1 scroller;
78
+ }
79
+
80
+ @utility gap-container {
81
+ @apply h-full flex flex-col gap-1 items-stretch justify-center;
82
+ }
83
+
84
+ @utility c-container {
85
+ @apply h-full grid scroller items-center justify-center p-2;
86
+ @apply grid-cols-1 relative;
87
+ & > main {
88
+ /* 要求c-container里只能有一个元素 即main */
89
+ @apply gap-container;
90
+ }
91
+ }
92
+
93
+ @utility center-fit {
94
+ @apply mx-auto w-fit text-center;
95
+ }
96
+
97
+ @utility high {
98
+ @apply text-(--xai-destructive);
99
+ }
100
+
101
+ @utility flex-text {
102
+ /* // 不能多行 */
103
+ @apply flex gap-1 items-center;
104
+ }
@@ -0,0 +1,36 @@
1
+ :root {
2
+ --xai-primary-dark: #e0d8c3;
3
+ --xai-primary-light: #f5f0e6;
4
+ --xai-primary: #fcfaf5;
5
+ --xai-text: #4a3b32;
6
+ --xai-text-muted: #8c7b70;
7
+ --xai-notable: #d69875;
8
+ --xai-border: #d1c6b6;
9
+ --xai-shadow: #8f826d;
10
+ --xai-destructive: #dc2626;
11
+ }
12
+
13
+ .dark {
14
+ --xai-primary: #3d221a;
15
+ --xai-primary-light: #705049;
16
+ --xai-primary-dark: #2a1712;
17
+ --xai-text: #ffd700;
18
+ --xai-text-muted: #ccad00;
19
+ --xai-notable: #d94a2f;
20
+ --xai-border: #3d0700;
21
+ --xai-shadow: #ffcbbd;
22
+ --xai-destructive: #ff5252;
23
+ }
24
+
25
+ .light {
26
+ --xai-primary: #ea9580; /* 主色:用于输入框、标题背景等 */
27
+ --xai-primary-dark: #c96f58; /* 深主色:用于页面大背景、模态框底层 */
28
+ --xai-primary-light: #ffdad2; /* 浅主色:用于 Card、容器背景 */
29
+ --xai-text: #332e00; /* 文本主色:几乎所有的正文 */
30
+ --xai-text-muted: #8c7b70; /* 次要文本:更加浅淡的文字 */
31
+ --xai-notable: #ff5555; /* 显眼色:用于 Primary Button、高亮开关、进度条等 */
32
+ --xai-border: #975c20; /* 边框色 */
33
+ /* 额外说的一下 有一个地方 是--xai-notable作为背景 --xai-primary-light作为文本前景 */
34
+ --xai-shadow: #000;
35
+ --xai-destructive: #d32f2f;
36
+ }
package/dist/index.d.ts CHANGED
@@ -157,7 +157,8 @@ export type ScaleComputer = undefined | ((scaler: Scaler) => number);
157
157
  export type ScaleIniter = (scaler: Scaler) => void;
158
158
  declare class Scaler {
159
159
  #private;
160
- element?: HTMLElement;
160
+ heightElement: HTMLElement;
161
+ widthElement: HTMLElement;
161
162
  set mainScale(val: number);
162
163
  get mainScale(): number;
163
164
  get scaleComputer(): ScaleComputer;
@@ -166,13 +167,14 @@ declare class Scaler {
166
167
  innerContainer: HTMLElement;
167
168
  constructor(innerContainer: HTMLElement);
168
169
  }
169
- export declare function useScaler(outerContainer: HTMLElement, initer?: ScaleIniter): Scaler | undefined;
170
+ export declare function enableScaler(outerContainer: HTMLElement, initer?: ScaleIniter, innerContainer?: HTMLElement): (() => void) | undefined;
170
171
  export declare const standardIniter: (args: {
171
- maxScreenWidth?: number;
172
+ maxAspectRatio?: number;
172
173
  setFullScreenWidth?: (x: number) => void;
173
174
  setFullContentHeight?: (x: number) => void;
174
175
  setMainScale?: (x: number) => void;
175
- element?: HTMLElement;
176
+ heightElement?: HTMLElement;
177
+ widthElement?: HTMLElement;
176
178
  }) => ScaleIniter;
177
179
  export declare class StringObfuscator {
178
180
  key: string;
@@ -185,7 +187,7 @@ export declare class StringObfuscator {
185
187
  export type Items<T> = {
186
188
  [key: string]: T;
187
189
  };
188
- export declare const DOZY = "1.0.21";
190
+ export declare const DOZY = "1.0.22";
189
191
  export * from "axios";
190
192
  export * from "zod";
191
193
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AAEnC,cAAc,OAAO,CAAA;AACrB,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,OAAO,CAAA;AAExC,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,EAAE,CAAC,EAAE,CAAA;AAEZ,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,WAAW,CAAA;AAI/C,cAAc,KAAK,CAAA;AACnB,OAAO,EAAE,OAAO,IAAI,CAAC,EAAE,MAAM,KAAK,CAAA;AAElC,eAAO,MAAM,IAAI,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AAEnC,cAAc,OAAO,CAAA;AACrB,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,OAAO,CAAA;AAExC,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,EAAE,CAAC,EAAE,CAAA;AAEZ,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,WAAW,CAAA;AAI/C,cAAc,KAAK,CAAA;AACnB,OAAO,EAAE,OAAO,IAAI,CAAC,EAAE,MAAM,KAAK,CAAA;AAElC,eAAO,MAAM,IAAI,WAAW,CAAA"}