@girumtech/gs-design-system-core 0.1.8 → 0.1.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/dist/index.d.ts +26 -22
- package/dist/index.js +36 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -134,28 +134,6 @@ declare const Text: tamagui.TamaguiComponent<_tamagui_web.TamaDefer, tamagui.Tam
|
|
|
134
134
|
tone?: "accent" | "danger" | "default" | "muted" | undefined;
|
|
135
135
|
}, _tamagui_web.StaticConfigPublic>;
|
|
136
136
|
|
|
137
|
-
declare const icons: {
|
|
138
|
-
readonly arrowRight: readonly [{
|
|
139
|
-
readonly d: "M5 12h14M13 6l6 6-6 6";
|
|
140
|
-
readonly fill: "none";
|
|
141
|
-
readonly stroke: "currentColor";
|
|
142
|
-
readonly strokeWidth: 2;
|
|
143
|
-
}];
|
|
144
|
-
readonly check: readonly [{
|
|
145
|
-
readonly d: "m5 12 4 4L19 6";
|
|
146
|
-
readonly fill: "none";
|
|
147
|
-
readonly stroke: "currentColor";
|
|
148
|
-
readonly strokeWidth: 2;
|
|
149
|
-
}];
|
|
150
|
-
readonly heart: readonly [{
|
|
151
|
-
readonly d: "M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1.1-1.1a5.5 5.5 0 0 0-7.8 7.8l1.1 1.1L12 21l7.7-7.5 1.1-1.1a5.5 5.5 0 0 0 0-7.8Z";
|
|
152
|
-
readonly fill: "none";
|
|
153
|
-
readonly stroke: "currentColor";
|
|
154
|
-
readonly strokeWidth: 2;
|
|
155
|
-
}];
|
|
156
|
-
};
|
|
157
|
-
type IconName = keyof typeof icons;
|
|
158
|
-
|
|
159
137
|
interface IconPath {
|
|
160
138
|
d: string;
|
|
161
139
|
fill?: string;
|
|
@@ -166,4 +144,30 @@ interface IconPath {
|
|
|
166
144
|
}
|
|
167
145
|
declare function normalizeIconPaths(paths: readonly IconPath[], color: string): IconPath[];
|
|
168
146
|
|
|
147
|
+
declare const icons: {
|
|
148
|
+
readonly ArrowRight: readonly IconPath[];
|
|
149
|
+
readonly Check: readonly IconPath[];
|
|
150
|
+
readonly Heart: readonly IconPath[];
|
|
151
|
+
readonly Plus: readonly IconPath[];
|
|
152
|
+
readonly Menu: readonly IconPath[];
|
|
153
|
+
readonly User: readonly IconPath[];
|
|
154
|
+
readonly ChevronRight: readonly IconPath[];
|
|
155
|
+
readonly ChevronLeft: readonly IconPath[];
|
|
156
|
+
readonly Logout: readonly IconPath[];
|
|
157
|
+
readonly Close: readonly IconPath[];
|
|
158
|
+
readonly Layers: readonly IconPath[];
|
|
159
|
+
readonly Box: readonly IconPath[];
|
|
160
|
+
readonly Edit: readonly IconPath[];
|
|
161
|
+
readonly Eye: readonly IconPath[];
|
|
162
|
+
readonly EyeOff: readonly IconPath[];
|
|
163
|
+
readonly Moon: readonly IconPath[];
|
|
164
|
+
readonly Sun: readonly IconPath[];
|
|
165
|
+
/** A currency/value glyph — a dollar-sign shape, theme-neutral so it also reads for BRL, EUR, etc. */
|
|
166
|
+
readonly Coin: readonly IconPath[];
|
|
167
|
+
/** Three vertical dots — the standard trigger for an overflow/"more actions" menu. */
|
|
168
|
+
readonly MoreVertical: readonly IconPath[];
|
|
169
|
+
readonly Trash: readonly IconPath[];
|
|
170
|
+
};
|
|
171
|
+
type IconName = keyof typeof icons;
|
|
172
|
+
|
|
169
173
|
export { Button, type ButtonProps, Field, type FieldProps, GsProvider, type GsProviderProps, GsThemeName, type IconName, type IconPath, Input, type InputProps, Text, Theme, type ThemeProps, icons, normalizeIconPaths };
|
package/dist/index.js
CHANGED
|
@@ -114,10 +114,43 @@ var Field = forwardRef2(
|
|
|
114
114
|
Field.displayName = "Field";
|
|
115
115
|
|
|
116
116
|
// src/icon-data.ts
|
|
117
|
+
var stroke = (d) => [
|
|
118
|
+
{ d, fill: "none", stroke: "currentColor", strokeWidth: 2 }
|
|
119
|
+
];
|
|
120
|
+
var solid = (d) => [{ d }];
|
|
117
121
|
var icons = {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
122
|
+
ArrowRight: stroke("M5 12h14M13 6l6 6-6 6"),
|
|
123
|
+
Check: stroke("m5 12 4 4L19 6"),
|
|
124
|
+
Heart: stroke(
|
|
125
|
+
"M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1.1-1.1a5.5 5.5 0 0 0-7.8 7.8l1.1 1.1L12 21l7.7-7.5 1.1-1.1a5.5 5.5 0 0 0 0-7.8Z"
|
|
126
|
+
),
|
|
127
|
+
Plus: stroke("M12 5v14M5 12h14"),
|
|
128
|
+
Menu: stroke("M4 6h16M4 12h16M4 18h16"),
|
|
129
|
+
User: stroke("M20 21a8 8 0 0 0-16 0M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z"),
|
|
130
|
+
ChevronRight: stroke("M9 6l6 6-6 6"),
|
|
131
|
+
ChevronLeft: stroke("M15 6l-6 6 6 6"),
|
|
132
|
+
Logout: stroke("M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9"),
|
|
133
|
+
Close: stroke("M6 6l12 12M18 6L6 18"),
|
|
134
|
+
Layers: stroke("M12 2 2 7l10 5 10-5-10-5ZM2 17l10 5 10-5M2 12l10 5 10-5"),
|
|
135
|
+
Box: stroke("M21 8l-9-5-9 5 9 5 9-5ZM3 8v8l9 5 9-5V8M12 13v8"),
|
|
136
|
+
Edit: stroke("M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"),
|
|
137
|
+
Eye: stroke("M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7zM9 12a3 3 0 1 0 6 0 3 3 0 1 0-6 0"),
|
|
138
|
+
EyeOff: stroke(
|
|
139
|
+
"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24M1 1L23 23"
|
|
140
|
+
),
|
|
141
|
+
Moon: stroke("M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"),
|
|
142
|
+
Sun: stroke(
|
|
143
|
+
"M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"
|
|
144
|
+
),
|
|
145
|
+
/** A currency/value glyph — a dollar-sign shape, theme-neutral so it also reads for BRL, EUR, etc. */
|
|
146
|
+
Coin: stroke("M12 1v22M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"),
|
|
147
|
+
/** Three vertical dots — the standard trigger for an overflow/"more actions" menu. */
|
|
148
|
+
MoreVertical: solid(
|
|
149
|
+
"M10.5 5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0M10.5 12a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0M10.5 19a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0"
|
|
150
|
+
),
|
|
151
|
+
Trash: stroke(
|
|
152
|
+
"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M10 11v6M14 11v6"
|
|
153
|
+
)
|
|
121
154
|
};
|
|
122
155
|
|
|
123
156
|
// src/icon-utils.ts
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme.tsx","../src/button.tsx","../src/input.tsx","../src/text.tsx","../src/icon-data.ts","../src/icon-utils.ts"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react'\nimport { TamaguiProvider, Theme as TamaguiTheme } from 'tamagui'\nimport { config, type GsThemeName } from './config'\n\nexport interface GsProviderProps {\n children: ReactNode\n defaultTheme?: GsThemeName\n}\n\nexport function GsProvider({ children, defaultTheme = 'red' }: GsProviderProps) {\n return <TamaguiProvider config={config} defaultTheme={defaultTheme}>{children}</TamaguiProvider>\n}\n\nexport interface ThemeProps extends Omit<ComponentProps<typeof TamaguiTheme>, 'name'> {\n name: GsThemeName\n}\n\nexport function Theme({ name, children, ...props }: ThemeProps) {\n return <TamaguiTheme name={name} {...props}>{children}</TamaguiTheme>\n}\n","import { forwardRef, type ComponentProps, type ReactNode } from 'react'\nimport { Button as TamaguiButton, Spinner, styled } from 'tamagui'\n\nconst StyledButton = styled(TamaguiButton, {\n name: 'GsButton',\n unstyled: true,\n justifyContent: 'center',\n alignItems: 'center',\n flexWrap: 'nowrap',\n flexDirection: 'row',\n borderWidth: 1,\n borderColor: '$accent',\n backgroundColor: '$accent',\n color: '$accentText',\n fontWeight: '600',\n cursor: 'pointer',\n focusStyle: { outlineColor: '$focus', outlineWidth: 3, outlineStyle: 'solid' },\n hoverStyle: { backgroundColor: '$accentHover', borderColor: '$accentHover' },\n pressStyle: { backgroundColor: '$accentPress', borderColor: '$accentPress', scale: 0.98 },\n disabledStyle: { opacity: 0.5, cursor: 'not-allowed' },\n variants: {\n intent: {\n primary: {},\n secondary: { backgroundColor: '$surface', color: '$color', borderColor: '$borderColor', hoverStyle: { borderColor: '$borderColorHover', backgroundColor: '$backgroundHover' } },\n ghost: { backgroundColor: 'transparent', color: '$accent', borderColor: 'transparent', hoverStyle: { backgroundColor: 'transparent', borderColor: 'transparent' }, pressStyle: { backgroundColor: 'transparent', borderColor: 'transparent', opacity: 0.7 }, focusStyle: { outlineColor: 'transparent' } },\n danger: { backgroundColor: '$danger', borderColor: '$danger', color: '$accentText' },\n },\n size: {\n sm: { height: 32, px: '$3', borderRadius: '$2', fontSize: '$2' },\n md: { height: 40, px: '$4', borderRadius: '$3', fontSize: '$3' },\n lg: { height: 48, px: '$5', borderRadius: '$4', fontSize: '$4' },\n },\n } as const,\n defaultVariants: { intent: 'primary', size: 'md' },\n})\n\nexport interface ButtonProps extends ComponentProps<typeof StyledButton> {\n loading?: boolean\n loadingLabel?: string\n children?: ReactNode\n}\n\nexport const Button = forwardRef<React.ComponentRef<typeof StyledButton>, ButtonProps>(\n ({ loading = false, loadingLabel = '', disabled, children, icon, borderColor, ...props }, ref) => {\n const iconProps = loading\n ? { icon: <Spinner size=\"small\" color=\"currentColor\" /> }\n : icon === undefined ? {} : { icon }\n\n return (\n <StyledButton gap=\"$2\" ref={ref} disabled={disabled || loading} aria-busy={loading} borderColor={borderColor ?? '$accent'} {...iconProps} {...props}>\n {loading ? loadingLabel : children}\n </StyledButton>\n )\n },\n)\nButton.displayName = 'Button'\n","import { forwardRef, type ComponentProps, type ReactNode } from 'react'\nimport { Input as TamaguiInput, Label, styled, YStack } from 'tamagui'\nimport { Text } from './text'\n\nconst StyledInput = styled(TamaguiInput, {\n name: 'GsInput', height: 44, borderWidth: 1, borderColor: '$borderSubtle', borderRadius: '$3',\n backgroundColor: '$background', color: '$color', px: '$3',\n placeholderTextColor: '$textMuted',\n // Focus is signalled with the border colour only. A CSS `outline` is drawn\n // outside the box and gets clipped by scroll containers on native.\n focusStyle: { borderColor: '$borderColorFocus' },\n disabledStyle: { opacity: 0.55, backgroundColor: '$surface' },\n variants: { invalid: { true: { borderColor: '$danger' } } } as const,\n})\n\nexport interface InputProps extends ComponentProps<typeof StyledInput> {}\n\nexport const Input = forwardRef<React.ComponentRef<typeof StyledInput>, InputProps>(({ borderColor, ...props }, ref) => (\n <StyledInput ref={ref} borderColor={borderColor ?? '$borderSubtle'} {...props} />\n))\nInput.displayName = 'Input'\n\nexport interface FieldProps extends InputProps {\n id: string\n label: string\n helperText?: ReactNode\n errorText?: ReactNode\n}\n\nexport const Field = forwardRef<React.ComponentRef<typeof StyledInput>, FieldProps>(\n ({ id, label, helperText, errorText, borderColor, ...props }, ref) => {\n const messageId = `${id}-message`\n return (\n <YStack gap=\"$2\">\n <Label htmlFor={id}><Text variant=\"label\">{label}</Text></Label>\n <StyledInput ref={ref} id={id} borderColor={borderColor ?? (errorText ? '$danger' : '$borderSubtle')} invalid={Boolean(errorText)} aria-invalid={Boolean(errorText)} aria-describedby={helperText || errorText ? messageId : undefined} {...props} />\n {(errorText || helperText) && <Text id={messageId} variant=\"caption\" tone={errorText ? 'danger' : 'default'} color={errorText ? undefined : '$textMuted'}>{errorText || helperText}</Text>}\n </YStack>\n )\n },\n)\nField.displayName = 'Field'\n","import { styled, Text as TamaguiText } from 'tamagui'\n\nexport const Text = styled(TamaguiText, {\n name: 'GsText',\n color: '$color',\n fontFamily: '$body',\n variants: {\n tone: { default: {}, muted: { color: '$colorMuted' }, accent: { color: '$accent' }, danger: { color: '$danger' } },\n variant: {\n caption: { fontSize: '$1', lineHeight: '$1' },\n body: { fontSize: '$3', lineHeight: '$3' },\n label: { fontSize: '$2', lineHeight: '$2', fontWeight: '600' },\n title: { fontSize: '$6', lineHeight: '$6', fontWeight: '700', letterSpacing: -0.2 },\n display: { fontSize: '$8', lineHeight: '$8', fontWeight: '700', letterSpacing: -0.8 },\n },\n } as const,\n defaultVariants: { tone: 'default', variant: 'body' },\n})\n","import type { IconPath } from './icon-utils'\n\nexport const icons = {\n arrowRight: [{ d: 'M5 12h14M13 6l6 6-6 6', fill: 'none', stroke: 'currentColor', strokeWidth: 2 }],\n check: [{ d: 'm5 12 4 4L19 6', fill: 'none', stroke: 'currentColor', strokeWidth: 2 }],\n heart: [{ d: 'M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1.1-1.1a5.5 5.5 0 0 0-7.8 7.8l1.1 1.1L12 21l7.7-7.5 1.1-1.1a5.5 5.5 0 0 0 0-7.8Z', fill: 'none', stroke: 'currentColor', strokeWidth: 2 }],\n} as const satisfies Record<string, readonly IconPath[]>\n\nexport type IconName = keyof typeof icons\n","export interface IconPath {\n d: string\n fill?: string\n stroke?: string\n strokeWidth?: number\n fillRule?: 'evenodd' | 'nonzero'\n clipRule?: 'evenodd' | 'nonzero'\n}\n\nexport function normalizeIconPaths(paths: readonly IconPath[], color: string): IconPath[] {\n return paths.map((path) => {\n const normalized: IconPath = { ...path, fill: path.fill ?? (path.stroke ? 'none' : color) }\n if (path.stroke !== undefined) normalized.stroke = path.stroke === 'currentColor' ? color : path.stroke\n return normalized\n })\n}\n"],"mappings":";;;;;;;AACA,SAAS,iBAAiB,SAAS,oBAAoB;AAS9C;AADF,SAAS,WAAW,EAAE,UAAU,eAAe,MAAM,GAAoB;AAC9E,SAAO,oBAAC,mBAAgB,QAAgB,cAA6B,UAAS;AAChF;AAMO,SAAS,MAAM,EAAE,MAAM,UAAU,GAAG,MAAM,GAAe;AAC9D,SAAO,oBAAC,gBAAa,MAAa,GAAG,OAAQ,UAAS;AACxD;;;ACnBA,SAAS,kBAAuD;AAChE,SAAS,UAAU,eAAe,SAAS,cAAc;AA4CzC,gBAAAA,YAAA;AA1ChB,IAAM,eAAe,OAAO,eAAe;AAAA,EACzC,MAAM;AAAA,EACN,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,eAAe;AAAA,EACf,aAAa;AAAA,EACb,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,YAAY,EAAE,cAAc,UAAU,cAAc,GAAG,cAAc,QAAQ;AAAA,EAC7E,YAAY,EAAE,iBAAiB,gBAAgB,aAAa,eAAe;AAAA,EAC3E,YAAY,EAAE,iBAAiB,gBAAgB,aAAa,gBAAgB,OAAO,KAAK;AAAA,EACxF,eAAe,EAAE,SAAS,KAAK,QAAQ,cAAc;AAAA,EACrD,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,SAAS,CAAC;AAAA,MACV,WAAW,EAAE,iBAAiB,YAAY,OAAO,UAAU,aAAa,gBAAgB,YAAY,EAAE,aAAa,qBAAqB,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AAM,GAAG,QAAQ;AACpE,UAAM,YAAY,GAAG,EAAE;AACvB,WACE,qBAAC,UAAO,KAAI,MACV;AAAA,sBAAAF,KAAC,SAAM,SAAS,IAAI,0BAAAA,KAAC,QAAK,SAAQ,SAAS,iBAAM,GAAO;AAAA,MACxD,gBAAAA,KAAC,eAAY,KAAU,IAAQ,aAAa,gBAAgB,YAAY,YAAY,kBAAkB,SAAS,QAAQ,SAAS,GAAG,gBAAc,QAAQ,SAAS,GAAG,oBAAkB,cAAc,YAAY,YAAY,QAAY,GAAG,OAAO;AAAA,OACjP,aAAa,eAAe,gBAAAA,KAAC,QAAK,IAAI,WAAW,SAAQ,WAAU,MAAM,YAAY,WAAW,WAAW,OAAO,YAAY,SAAY,cAAe,uBAAa,YAAW;AAAA,OACrL;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;;;AEvCb,IAAM,QAAQ;AAAA,EACnB,YAAY,CAAC,EAAE,GAAG,yBAAyB,MAAM,QAAQ,QAAQ,gBAAgB,aAAa,EAAE,CAAC;AAAA,EACjG,OAAO,CAAC,EAAE,GAAG,kBAAkB,MAAM,QAAQ,QAAQ,gBAAgB,aAAa,EAAE,CAAC;AAAA,EACrF,OAAO,CAAC,EAAE,GAAG,0HAA0H,MAAM,QAAQ,QAAQ,gBAAgB,aAAa,EAAE,CAAC;AAC/L;;;ACGO,SAAS,mBAAmB,OAA4B,OAA2B;AACxF,SAAO,MAAM,IAAI,CAAC,SAAS;AACzB,UAAM,aAAuB,EAAE,GAAG,MAAM,MAAM,KAAK,SAAS,KAAK,SAAS,SAAS,OAAO;AAC1F,QAAI,KAAK,WAAW,OAAW,YAAW,SAAS,KAAK,WAAW,iBAAiB,QAAQ,KAAK;AACjG,WAAO;AAAA,EACT,CAAC;AACH;","names":["jsx","forwardRef","styled","styled","jsx","styled","forwardRef"]}
|
|
1
|
+
{"version":3,"sources":["../src/theme.tsx","../src/button.tsx","../src/input.tsx","../src/text.tsx","../src/icon-data.ts","../src/icon-utils.ts"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react'\nimport { TamaguiProvider, Theme as TamaguiTheme } from 'tamagui'\nimport { config, type GsThemeName } from './config'\n\nexport interface GsProviderProps {\n children: ReactNode\n defaultTheme?: GsThemeName\n}\n\nexport function GsProvider({ children, defaultTheme = 'red' }: GsProviderProps) {\n return <TamaguiProvider config={config} defaultTheme={defaultTheme}>{children}</TamaguiProvider>\n}\n\nexport interface ThemeProps extends Omit<ComponentProps<typeof TamaguiTheme>, 'name'> {\n name: GsThemeName\n}\n\nexport function Theme({ name, children, ...props }: ThemeProps) {\n return <TamaguiTheme name={name} {...props}>{children}</TamaguiTheme>\n}\n","import { forwardRef, type ComponentProps, type ReactNode } from 'react'\nimport { Button as TamaguiButton, Spinner, styled } from 'tamagui'\n\nconst StyledButton = styled(TamaguiButton, {\n name: 'GsButton',\n unstyled: true,\n justifyContent: 'center',\n alignItems: 'center',\n flexWrap: 'nowrap',\n flexDirection: 'row',\n borderWidth: 1,\n borderColor: '$accent',\n backgroundColor: '$accent',\n color: '$accentText',\n fontWeight: '600',\n cursor: 'pointer',\n focusStyle: { outlineColor: '$focus', outlineWidth: 3, outlineStyle: 'solid' },\n hoverStyle: { backgroundColor: '$accentHover', borderColor: '$accentHover' },\n pressStyle: { backgroundColor: '$accentPress', borderColor: '$accentPress', scale: 0.98 },\n disabledStyle: { opacity: 0.5, cursor: 'not-allowed' },\n variants: {\n intent: {\n primary: {},\n secondary: { backgroundColor: '$surface', color: '$color', borderColor: '$borderColor', hoverStyle: { borderColor: '$borderColorHover', backgroundColor: '$backgroundHover' } },\n ghost: { backgroundColor: 'transparent', color: '$accent', borderColor: 'transparent', hoverStyle: { backgroundColor: 'transparent', borderColor: 'transparent' }, pressStyle: { backgroundColor: 'transparent', borderColor: 'transparent', opacity: 0.7 }, focusStyle: { outlineColor: 'transparent' } },\n danger: { backgroundColor: '$danger', borderColor: '$danger', color: '$accentText' },\n },\n size: {\n sm: { height: 32, px: '$3', borderRadius: '$2', fontSize: '$2' },\n md: { height: 40, px: '$4', borderRadius: '$3', fontSize: '$3' },\n lg: { height: 48, px: '$5', borderRadius: '$4', fontSize: '$4' },\n },\n } as const,\n defaultVariants: { intent: 'primary', size: 'md' },\n})\n\nexport interface ButtonProps extends ComponentProps<typeof StyledButton> {\n loading?: boolean\n loadingLabel?: string\n children?: ReactNode\n}\n\nexport const Button = forwardRef<React.ComponentRef<typeof StyledButton>, ButtonProps>(\n ({ loading = false, loadingLabel = '', disabled, children, icon, borderColor, ...props }, ref) => {\n const iconProps = loading\n ? { icon: <Spinner size=\"small\" color=\"currentColor\" /> }\n : icon === undefined ? {} : { icon }\n\n return (\n <StyledButton gap=\"$2\" ref={ref} disabled={disabled || loading} aria-busy={loading} borderColor={borderColor ?? '$accent'} {...iconProps} {...props}>\n {loading ? loadingLabel : children}\n </StyledButton>\n )\n },\n)\nButton.displayName = 'Button'\n","import { forwardRef, type ComponentProps, type ReactNode } from 'react'\nimport { Input as TamaguiInput, Label, styled, YStack } from 'tamagui'\nimport { Text } from './text'\n\nconst StyledInput = styled(TamaguiInput, {\n name: 'GsInput', height: 44, borderWidth: 1, borderColor: '$borderSubtle', borderRadius: '$3',\n backgroundColor: '$background', color: '$color', px: '$3',\n placeholderTextColor: '$textMuted',\n // Focus is signalled with the border colour only. A CSS `outline` is drawn\n // outside the box and gets clipped by scroll containers on native.\n focusStyle: { borderColor: '$borderColorFocus' },\n disabledStyle: { opacity: 0.55, backgroundColor: '$surface' },\n variants: { invalid: { true: { borderColor: '$danger' } } } as const,\n})\n\nexport interface InputProps extends ComponentProps<typeof StyledInput> {}\n\nexport const Input = forwardRef<React.ComponentRef<typeof StyledInput>, InputProps>(({ borderColor, ...props }, ref) => (\n <StyledInput ref={ref} borderColor={borderColor ?? '$borderSubtle'} {...props} />\n))\nInput.displayName = 'Input'\n\nexport interface FieldProps extends InputProps {\n id: string\n label: string\n helperText?: ReactNode\n errorText?: ReactNode\n}\n\nexport const Field = forwardRef<React.ComponentRef<typeof StyledInput>, FieldProps>(\n ({ id, label, helperText, errorText, borderColor, ...props }, ref) => {\n const messageId = `${id}-message`\n return (\n <YStack gap=\"$2\">\n <Label htmlFor={id}><Text variant=\"label\">{label}</Text></Label>\n <StyledInput ref={ref} id={id} borderColor={borderColor ?? (errorText ? '$danger' : '$borderSubtle')} invalid={Boolean(errorText)} aria-invalid={Boolean(errorText)} aria-describedby={helperText || errorText ? messageId : undefined} {...props} />\n {(errorText || helperText) && <Text id={messageId} variant=\"caption\" tone={errorText ? 'danger' : 'default'} color={errorText ? undefined : '$textMuted'}>{errorText || helperText}</Text>}\n </YStack>\n )\n },\n)\nField.displayName = 'Field'\n","import { styled, Text as TamaguiText } from 'tamagui'\n\nexport const Text = styled(TamaguiText, {\n name: 'GsText',\n color: '$color',\n fontFamily: '$body',\n variants: {\n tone: { default: {}, muted: { color: '$colorMuted' }, accent: { color: '$accent' }, danger: { color: '$danger' } },\n variant: {\n caption: { fontSize: '$1', lineHeight: '$1' },\n body: { fontSize: '$3', lineHeight: '$3' },\n label: { fontSize: '$2', lineHeight: '$2', fontWeight: '600' },\n title: { fontSize: '$6', lineHeight: '$6', fontWeight: '700', letterSpacing: -0.2 },\n display: { fontSize: '$8', lineHeight: '$8', fontWeight: '700', letterSpacing: -0.8 },\n },\n } as const,\n defaultVariants: { tone: 'default', variant: 'body' },\n})\n","import type { IconPath } from './icon-utils'\n\nconst stroke = (d: string): readonly IconPath[] => [\n { d, fill: 'none', stroke: 'currentColor', strokeWidth: 2 },\n]\n\n// No `fill`/`stroke` set here on purpose: `normalizeIconPaths` fills an\n// unmarked path with the resolved color, which is what a solid glyph needs.\nconst solid = (d: string): readonly IconPath[] => [{ d }]\n\nexport const icons = {\n ArrowRight: stroke('M5 12h14M13 6l6 6-6 6'),\n Check: stroke('m5 12 4 4L19 6'),\n Heart: stroke(\n 'M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1.1-1.1a5.5 5.5 0 0 0-7.8 7.8l1.1 1.1L12 21l7.7-7.5 1.1-1.1a5.5 5.5 0 0 0 0-7.8Z'\n ),\n Plus: stroke('M12 5v14M5 12h14'),\n Menu: stroke('M4 6h16M4 12h16M4 18h16'),\n User: stroke('M20 21a8 8 0 0 0-16 0M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z'),\n ChevronRight: stroke('M9 6l6 6-6 6'),\n ChevronLeft: stroke('M15 6l-6 6 6 6'),\n Logout: stroke('M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9'),\n Close: stroke('M6 6l12 12M18 6L6 18'),\n Layers: stroke('M12 2 2 7l10 5 10-5-10-5ZM2 17l10 5 10-5M2 12l10 5 10-5'),\n Box: stroke('M21 8l-9-5-9 5 9 5 9-5ZM3 8v8l9 5 9-5V8M12 13v8'),\n Edit: stroke('M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'),\n Eye: stroke('M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7zM9 12a3 3 0 1 0 6 0 3 3 0 1 0-6 0'),\n EyeOff: stroke(\n 'M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24M1 1L23 23'\n ),\n Moon: stroke('M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'),\n Sun: stroke(\n 'M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42'\n ),\n /** A currency/value glyph — a dollar-sign shape, theme-neutral so it also reads for BRL, EUR, etc. */\n Coin: stroke('M12 1v22M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'),\n /** Three vertical dots — the standard trigger for an overflow/\"more actions\" menu. */\n MoreVertical: solid(\n 'M10.5 5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0M10.5 12a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0M10.5 19a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0'\n ),\n Trash: stroke(\n 'M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M10 11v6M14 11v6'\n ),\n} as const satisfies Record<string, readonly IconPath[]>\n\nexport type IconName = keyof typeof icons\n","export interface IconPath {\n d: string\n fill?: string\n stroke?: string\n strokeWidth?: number\n fillRule?: 'evenodd' | 'nonzero'\n clipRule?: 'evenodd' | 'nonzero'\n}\n\nexport function normalizeIconPaths(paths: readonly IconPath[], color: string): IconPath[] {\n return paths.map((path) => {\n const normalized: IconPath = { ...path, fill: path.fill ?? (path.stroke ? 'none' : color) }\n if (path.stroke !== undefined) normalized.stroke = path.stroke === 'currentColor' ? color : path.stroke\n return normalized\n })\n}\n"],"mappings":";;;;;;;AACA,SAAS,iBAAiB,SAAS,oBAAoB;AAS9C;AADF,SAAS,WAAW,EAAE,UAAU,eAAe,MAAM,GAAoB;AAC9E,SAAO,oBAAC,mBAAgB,QAAgB,cAA6B,UAAS;AAChF;AAMO,SAAS,MAAM,EAAE,MAAM,UAAU,GAAG,MAAM,GAAe;AAC9D,SAAO,oBAAC,gBAAa,MAAa,GAAG,OAAQ,UAAS;AACxD;;;ACnBA,SAAS,kBAAuD;AAChE,SAAS,UAAU,eAAe,SAAS,cAAc;AA4CzC,gBAAAA,YAAA;AA1ChB,IAAM,eAAe,OAAO,eAAe;AAAA,EACzC,MAAM;AAAA,EACN,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,eAAe;A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