@300codes/design-system 1.2.8 → 1.2.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@300codes/design-system",
3
- "version": "1.2.8",
3
+ "version": "1.2.10",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/components",
@@ -33,19 +33,29 @@ const isServer = typeof window === 'undefined';
33
33
  const notFound =
34
34
  '<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 256 256"><path d="M48,48V208H80a8,8,0,0,1,0,16H40a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8H80a8,8,0,0,1,0,16ZM216,32H176a8,8,0,0,0,0,16h32V208H176a8,8,0,0,0,0,16h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Z"></path></svg>';
35
35
 
36
- // DS_PUBLIC_PATH overrides the server-side base directory (e.g. client for Astro, .output/public for Nuxt).
37
- const serverBase = import.meta.env.PROD ? (import.meta.env.DS_PUBLIC_PATH || 'client') : 'public';
36
+ const serverBase: string = (() => {
37
+ if (!isServer) return '';
38
+ if (!import.meta.env.PROD) return `${process.cwd()}/public`;
39
+ if (import.meta.env.DS_PUBLIC_PATH) {
40
+ const p: string = import.meta.env.DS_PUBLIC_PATH;
41
+ return p.startsWith('/') ? p : `${process.cwd()}/${p}`;
42
+ }
43
+ // In production SSR this module is bundled inside <dist>/server/ (or a subdir).
44
+ // Find that boundary and swap /server/... for /client.
45
+ const moduleDir = new URL('.', import.meta.url).pathname;
46
+ const sep = moduleDir.lastIndexOf('/server/');
47
+ return sep >= 0 ? `${moduleDir.slice(0, sep)}/client` : `${process.cwd()}/dist/client`;
48
+ })();
38
49
 
39
50
  async function getSvgContent(name: string): Promise<string> {
40
51
  const warnNotFound = () =>
41
52
  console.warn(`[BaseIcon] Icon "${name}" not found at ${props.iconPath}/${name}.svg`);
42
53
 
43
54
  if (isServer) {
44
- const path = await import('path');
55
+ const pathModule = await import('path');
45
56
  const fs = await import('fs/promises');
46
-
47
57
  try {
48
- const filePath = path.join(process.cwd(), serverBase, props.iconPath, `${name}.svg`);
58
+ const filePath = pathModule.join(serverBase, props.iconPath, `${name}.svg`);
49
59
  return await fs.readFile(filePath, 'utf8');
50
60
  } catch {
51
61
  warnNotFound();
@@ -145,9 +145,9 @@ const nativeAttrs = computed((): Record<string, unknown> => {
145
145
 
146
146
  .simpleButton--tertiary {
147
147
  --_fg: var(--simpleButton-tertiary-fg, #0e161b);
148
- background-color: var(--simpleButton-tertiary-bg, transparent);
148
+ background-color: var(--simpleButton-tertiary-bg, #ffffff);
149
149
  color: var(--_fg);
150
- border-color: var(--simpleButton-tertiary-border, transparent);
150
+ border-color: var(--simpleButton-tertiary-border, #ffffff);
151
151
  }
152
152
 
153
153
  .simpleButton--tertiary:hover:not(.simpleButton--disabled) {
@@ -162,9 +162,9 @@ const nativeAttrs = computed((): Record<string, unknown> => {
162
162
 
163
163
  .simpleButton--tertiary.simpleButton--disabled {
164
164
  --_fg: var(--simpleButton-tertiary-disabled-fg, #89979f);
165
- background-color: var(--simpleButton-tertiary-disabled-bg, transparent);
165
+ background-color: var(--simpleButton-tertiary-disabled-bg, #ffffff);
166
166
  color: var(--_fg);
167
- border-color: var(--simpleButton-tertiary-disabled-border, transparent);
167
+ border-color: var(--simpleButton-tertiary-disabled-border, #ffffff);
168
168
  }
169
169
 
170
170
  /* ── sm ── */
@@ -67,16 +67,16 @@
67
67
  --simpleButton-secondary-disabled-border: theme(--color-disabled);
68
68
 
69
69
  /* tertiary */
70
- --simpleButton-tertiary-bg: transparent;
70
+ --simpleButton-tertiary-bg: theme(--color-white);
71
71
  --simpleButton-tertiary-fg: theme(--color-tertiary-foreground);
72
- --simpleButton-tertiary-border: transparent;
72
+ --simpleButton-tertiary-border: theme(--color-white);
73
73
  --simpleButton-tertiary-bg-hover: theme(--color-tertiary-hover);
74
74
  --simpleButton-tertiary-fg-hover: theme(--color-tertiary-foreground);
75
75
  --simpleButton-tertiary-border-hover: theme(--color-tertiary-hover);
76
76
  --simpleButton-tertiary-ring: theme(--color-ring);
77
- --simpleButton-tertiary-disabled-bg: transparent;
77
+ --simpleButton-tertiary-disabled-bg: theme(--color-white);
78
78
  --simpleButton-tertiary-disabled-fg: theme(--color-disabled-foreground);
79
- --simpleButton-tertiary-disabled-border: transparent;
79
+ --simpleButton-tertiary-disabled-border: theme(--color-white);
80
80
 
81
81
  /* sm */
82
82
  --simpleButton-sm-px: theme(--spacing-4);