@blockle/blocks 0.6.0 → 0.7.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/index.cjs +189 -160
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +189 -160
- package/dist/momotaro.chunk.d.ts +113 -68
- package/dist/styles/themes/momotaro/components/button.css.cjs +1 -1
- package/dist/styles/themes/momotaro/components/button.css.mjs +1 -1
- package/dist/styles/themes/momotaro/components/checkbox.css.cjs +53 -0
- package/dist/styles/themes/momotaro/components/checkbox.css.mjs +54 -0
- package/dist/styles/themes/momotaro/components/helpers.css.cjs +13 -0
- package/dist/styles/themes/momotaro/components/helpers.css.mjs +13 -0
- package/dist/styles/themes/momotaro/components/index.cjs +7 -1
- package/dist/styles/themes/momotaro/components/index.mjs +7 -1
- package/dist/styles/themes/momotaro/components/input.css.cjs +3 -3
- package/dist/styles/themes/momotaro/components/input.css.mjs +3 -3
- package/dist/styles/themes/momotaro/components/label.css.cjs +33 -0
- package/dist/styles/themes/momotaro/components/label.css.mjs +34 -0
- package/dist/styles/themes/momotaro/components/link.css.cjs +1 -0
- package/dist/styles/themes/momotaro/components/link.css.mjs +1 -0
- package/dist/styles/themes/momotaro/components/radio.css.cjs +53 -0
- package/dist/styles/themes/momotaro/components/radio.css.mjs +54 -0
- package/dist/styles/themes/momotaro/components/transitions.cjs +3 -0
- package/dist/styles/themes/momotaro/components/transitions.mjs +4 -0
- package/package.json +2 -2
package/dist/momotaro.chunk.d.ts
CHANGED
|
@@ -248,9 +248,6 @@ declare const breakpointQuery: (key: Breakpoint) => string;
|
|
|
248
248
|
*/
|
|
249
249
|
type OptionalLiteral<T extends string> = T | (string & {});
|
|
250
250
|
type RecordLike = Record<string | number, unknown>;
|
|
251
|
-
type IsStringUnion<T> = T extends string ? (string extends T ? false : true) : false;
|
|
252
|
-
type IsNumberUnion<T> = T extends number ? (number extends T ? false : true) : false;
|
|
253
|
-
type IsUnion<T> = IsStringUnion<T> extends true ? true : IsNumberUnion<T> extends true ? true : false;
|
|
254
251
|
|
|
255
252
|
type Atoms = Parameters<typeof atoms>[0];
|
|
256
253
|
type ResponsiveValue<T> = T | [T] | [T, T] | [T, T, T] | [T, T, T, T];
|
|
@@ -278,7 +275,7 @@ type MarginAndPaddingAtoms = MarginAtoms & PaddingAtoms;
|
|
|
278
275
|
type ButtonTheme = {
|
|
279
276
|
base: string;
|
|
280
277
|
variants: {
|
|
281
|
-
variant: 'solid' | 'outline' | 'ghost'
|
|
278
|
+
variant: 'solid' | 'outline' | 'ghost';
|
|
282
279
|
intent: 'neutral' | 'danger';
|
|
283
280
|
size: 'small' | 'medium' | 'large';
|
|
284
281
|
loading: boolean;
|
|
@@ -300,7 +297,7 @@ type SpinnerTheme = {
|
|
|
300
297
|
};
|
|
301
298
|
};
|
|
302
299
|
type DividerTheme = {
|
|
303
|
-
base
|
|
300
|
+
base?: string;
|
|
304
301
|
variants: {
|
|
305
302
|
color: Exclude<Atoms['color'], undefined>;
|
|
306
303
|
};
|
|
@@ -316,22 +313,52 @@ type InputTheme = {
|
|
|
316
313
|
container: string;
|
|
317
314
|
input: string;
|
|
318
315
|
variants: {
|
|
316
|
+
variant: 'solid' | 'outline';
|
|
319
317
|
disabled: boolean;
|
|
318
|
+
required: boolean;
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
type CheckboxTheme = {
|
|
322
|
+
base: string;
|
|
323
|
+
icon: string;
|
|
324
|
+
label: string;
|
|
325
|
+
variants: {
|
|
326
|
+
required: boolean;
|
|
320
327
|
};
|
|
321
328
|
};
|
|
322
|
-
type
|
|
329
|
+
type RadioTheme = {
|
|
330
|
+
base: string;
|
|
331
|
+
icon: string;
|
|
332
|
+
label: string;
|
|
333
|
+
};
|
|
334
|
+
type LabelTheme = {
|
|
335
|
+
base: string;
|
|
336
|
+
variants: {
|
|
337
|
+
size: 'small' | 'medium' | 'large';
|
|
338
|
+
required: boolean;
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
type ComponentThemes = {
|
|
323
342
|
button: ButtonTheme;
|
|
324
343
|
link: LinkTheme;
|
|
325
344
|
spinner: SpinnerTheme;
|
|
326
345
|
divider: DividerTheme;
|
|
327
346
|
dialog: DialogTheme;
|
|
328
347
|
input: InputTheme;
|
|
348
|
+
checkbox: CheckboxTheme;
|
|
349
|
+
radio: RadioTheme;
|
|
350
|
+
label: LabelTheme;
|
|
329
351
|
};
|
|
330
|
-
|
|
331
|
-
|
|
352
|
+
/**
|
|
353
|
+
* ComponentThemeProps is a helper type to define the props passed to useComponentStyles.
|
|
354
|
+
*/
|
|
355
|
+
type ComponentThemeProps<T extends RecordLike> = Omit<{
|
|
356
|
+
[K in keyof T]?: Exclude<T[K], undefined> extends string ? boolean : never;
|
|
357
|
+
}, 'variants'> & {
|
|
358
|
+
variants?: T['variants'] extends RecordLike ? Partial<T['variants']> : never;
|
|
332
359
|
};
|
|
333
|
-
type
|
|
334
|
-
[K in keyof
|
|
360
|
+
type ComponentThemesProps = {
|
|
361
|
+
[K in keyof ComponentThemes]: ComponentThemeProps<ComponentThemes[K]>;
|
|
335
362
|
};
|
|
336
363
|
|
|
337
364
|
/**
|
|
@@ -354,8 +381,14 @@ type ThemeComponentProps<T extends RecordLike> = {
|
|
|
354
381
|
* };
|
|
355
382
|
* };
|
|
356
383
|
*/
|
|
357
|
-
type
|
|
358
|
-
[K in keyof T]?: T[K] extends
|
|
384
|
+
type VariantsToStyle<T extends RecordLike> = {
|
|
385
|
+
[K in keyof T]?: T[K] extends string | number ? Partial<Record<T[K], string>> : T[K] extends boolean ? string : never;
|
|
386
|
+
};
|
|
387
|
+
/**
|
|
388
|
+
* ComponentThemeToStyles is a helper type to define the props passed to useComponentStyles.
|
|
389
|
+
*/
|
|
390
|
+
type ComponentThemeToStyles<T extends RecordLike> = Omit<T, 'variants'> & {
|
|
391
|
+
variants?: T['variants'] extends RecordLike ? VariantsToStyle<T['variants']> : never;
|
|
359
392
|
};
|
|
360
393
|
type ComponentThemeCompoundVariants<T extends RecordLike> = T['variants'] extends RecordLike ? {
|
|
361
394
|
variants: {
|
|
@@ -371,7 +404,7 @@ type ComponentTheme<T extends RecordLike> = ComponentThemeToStyles<T> & {
|
|
|
371
404
|
defaultVariants?: ComponentThemeDefaultVariants<T>;
|
|
372
405
|
};
|
|
373
406
|
type ThemeComponentsStyles = {
|
|
374
|
-
[K in keyof
|
|
407
|
+
[K in keyof ComponentThemes]: ComponentTheme<ComponentThemes[K]>;
|
|
375
408
|
};
|
|
376
409
|
declare function makeComponentTheme<T extends keyof ThemeComponentsStyles>(component: T, componentTheme: ThemeComponentsStyles[T]): ThemeComponentsStyles[T];
|
|
377
410
|
|
|
@@ -411,12 +444,12 @@ type ThemeTokens = {
|
|
|
411
444
|
type ThemeInput = {
|
|
412
445
|
name: string;
|
|
413
446
|
tokens: ThemeTokens;
|
|
414
|
-
components:
|
|
447
|
+
components: ThemeComponentsStyles;
|
|
415
448
|
};
|
|
416
449
|
type Theme = {
|
|
417
450
|
name: string;
|
|
418
451
|
vars: string;
|
|
419
|
-
components:
|
|
452
|
+
components: ThemeComponentsStyles;
|
|
420
453
|
};
|
|
421
454
|
declare function makeTheme(theme: ThemeInput): Theme;
|
|
422
455
|
|
|
@@ -530,7 +563,7 @@ type ButtonProps = {
|
|
|
530
563
|
declare const Button: react.ForwardRefExoticComponent<{
|
|
531
564
|
children: ReactNode;
|
|
532
565
|
type?: "button" | "submit" | "reset" | undefined;
|
|
533
|
-
variant?: "
|
|
566
|
+
variant?: "outline" | "solid" | "ghost" | undefined;
|
|
534
567
|
intent?: "danger" | "neutral" | undefined;
|
|
535
568
|
size?: "small" | "medium" | "large" | undefined;
|
|
536
569
|
width?: Atoms['width'];
|
|
@@ -541,6 +574,23 @@ declare const Button: react.ForwardRefExoticComponent<{
|
|
|
541
574
|
disabled?: boolean | undefined;
|
|
542
575
|
} & Omit<HTMLElementProps<HTMLButtonElement>, "size"> & react.RefAttributes<HTMLButtonElement>>;
|
|
543
576
|
|
|
577
|
+
type DialogProps = {
|
|
578
|
+
children?: ReactNode;
|
|
579
|
+
open: boolean;
|
|
580
|
+
onRequestClose: () => void;
|
|
581
|
+
className?: string;
|
|
582
|
+
size?: DialogTheme['variants']['size'];
|
|
583
|
+
'aria-label'?: string;
|
|
584
|
+
};
|
|
585
|
+
declare const Dialog: FC<DialogProps>;
|
|
586
|
+
|
|
587
|
+
type DividerProps = {
|
|
588
|
+
className?: string;
|
|
589
|
+
color?: Atoms['backgroundColor'];
|
|
590
|
+
style?: React.CSSProperties;
|
|
591
|
+
};
|
|
592
|
+
declare const Divider: FC<DividerProps>;
|
|
593
|
+
|
|
544
594
|
type HeadingProps = {
|
|
545
595
|
align?: Atoms['textAlign'];
|
|
546
596
|
children: React.ReactNode;
|
|
@@ -580,6 +630,49 @@ type InlineProps = {
|
|
|
580
630
|
} & MarginAndPaddingAtoms;
|
|
581
631
|
declare const Inline: React.FC<InlineProps>;
|
|
582
632
|
|
|
633
|
+
type InputProps = {
|
|
634
|
+
className?: string;
|
|
635
|
+
name: string;
|
|
636
|
+
type?: OptionalLiteral<'email' | 'number' | 'password' | 'tel' | 'text' | 'url'>;
|
|
637
|
+
startSlot?: ReactNode;
|
|
638
|
+
endSlot?: ReactNode;
|
|
639
|
+
label: string;
|
|
640
|
+
} & Omit<HTMLElementProps<HTMLInputElement>, 'type'>;
|
|
641
|
+
declare const Input: react.ForwardRefExoticComponent<{
|
|
642
|
+
className?: string | undefined;
|
|
643
|
+
name: string;
|
|
644
|
+
type?: OptionalLiteral<"number" | "text" | "tel" | "url" | "email" | "password"> | undefined;
|
|
645
|
+
startSlot?: ReactNode;
|
|
646
|
+
endSlot?: ReactNode;
|
|
647
|
+
label: string;
|
|
648
|
+
} & Omit<HTMLElementProps<HTMLInputElement>, "type"> & react.RefAttributes<HTMLInputElement>>;
|
|
649
|
+
|
|
650
|
+
type LabelProps = {
|
|
651
|
+
visualOnly?: boolean;
|
|
652
|
+
htmlFor?: string;
|
|
653
|
+
children?: React.ReactNode;
|
|
654
|
+
required?: boolean;
|
|
655
|
+
size?: LabelTheme['variants']['size'];
|
|
656
|
+
cursor?: Atoms['cursor'];
|
|
657
|
+
} & HTMLElementProps<HTMLLabelElement>;
|
|
658
|
+
declare const Label: React.FC<LabelProps>;
|
|
659
|
+
|
|
660
|
+
type LinkProps = {
|
|
661
|
+
children?: ReactNode;
|
|
662
|
+
underline?: LinkTheme['variants']['underline'];
|
|
663
|
+
variant?: LinkTheme['variants']['variant'];
|
|
664
|
+
} & Atoms & HTMLElementProps<HTMLAnchorElement>;
|
|
665
|
+
type PolymorphicLink = ForwardRefComponent<'a', LinkProps>;
|
|
666
|
+
declare const Link: PolymorphicLink;
|
|
667
|
+
|
|
668
|
+
type SpinnerProps = {
|
|
669
|
+
className?: string;
|
|
670
|
+
color?: SpinnerTheme['variants']['color'];
|
|
671
|
+
size?: SpinnerTheme['variants']['size'];
|
|
672
|
+
style?: React.CSSProperties;
|
|
673
|
+
} & MarginAtoms;
|
|
674
|
+
declare const Spinner: FC<SpinnerProps>;
|
|
675
|
+
|
|
583
676
|
type StackProps = {
|
|
584
677
|
alignX?: keyof AlignItemsMap;
|
|
585
678
|
as?: 'div' | 'section' | 'ul' | 'ol';
|
|
@@ -588,6 +681,7 @@ type StackProps = {
|
|
|
588
681
|
display?: ResponsiveDisplayFlex;
|
|
589
682
|
gap: Atoms['gap'];
|
|
590
683
|
style?: React.CSSProperties;
|
|
684
|
+
role?: React.AriaRole;
|
|
591
685
|
/**
|
|
592
686
|
* Start prop is only valid when as="ol"
|
|
593
687
|
*/
|
|
@@ -612,66 +706,17 @@ type TextProps = {
|
|
|
612
706
|
} & MarginAndPaddingAtoms & HTMLElementProps<HTMLSpanElement>;
|
|
613
707
|
declare const Text: React.FC<TextProps>;
|
|
614
708
|
|
|
615
|
-
|
|
616
|
-
children?: ReactNode;
|
|
617
|
-
underline?: LinkTheme['variants']['underline'];
|
|
618
|
-
variant?: LinkTheme['variants']['variant'];
|
|
619
|
-
} & Atoms & HTMLElementProps<HTMLAnchorElement>;
|
|
620
|
-
type PolymorphicLink = ForwardRefComponent<'a', LinkProps>;
|
|
621
|
-
declare const Link: PolymorphicLink;
|
|
622
|
-
|
|
623
|
-
type SpinnerProps = {
|
|
624
|
-
className?: string;
|
|
625
|
-
color?: SpinnerTheme['variants']['color'];
|
|
626
|
-
size?: SpinnerTheme['variants']['size'];
|
|
627
|
-
style?: React.CSSProperties;
|
|
628
|
-
} & MarginAtoms;
|
|
629
|
-
declare const Spinner: FC<SpinnerProps>;
|
|
630
|
-
|
|
631
|
-
type DividerProps = {
|
|
632
|
-
className?: string;
|
|
633
|
-
color?: Atoms['backgroundColor'];
|
|
634
|
-
style?: React.CSSProperties;
|
|
635
|
-
};
|
|
636
|
-
declare const Divider: FC<DividerProps>;
|
|
637
|
-
|
|
638
|
-
type DialogProps = {
|
|
639
|
-
children?: ReactNode;
|
|
640
|
-
open: boolean;
|
|
641
|
-
onRequestClose: () => void;
|
|
642
|
-
className?: string;
|
|
643
|
-
size?: DialogTheme['variants']['size'];
|
|
644
|
-
};
|
|
645
|
-
declare const Dialog: FC<DialogProps>;
|
|
646
|
-
|
|
647
|
-
type InputProps = {
|
|
648
|
-
className?: string;
|
|
649
|
-
name: string;
|
|
650
|
-
type?: OptionalLiteral<'email' | 'number' | 'password' | 'tel' | 'text' | 'url'>;
|
|
651
|
-
startSlot?: ReactNode;
|
|
652
|
-
endSlot?: ReactNode;
|
|
653
|
-
label: string;
|
|
654
|
-
} & Omit<HTMLElementProps<HTMLInputElement>, 'type'>;
|
|
655
|
-
declare const Input: react.ForwardRefExoticComponent<{
|
|
656
|
-
className?: string | undefined;
|
|
657
|
-
name: string;
|
|
658
|
-
type?: OptionalLiteral<"number" | "text" | "tel" | "url" | "email" | "password"> | undefined;
|
|
659
|
-
startSlot?: ReactNode;
|
|
660
|
-
endSlot?: ReactNode;
|
|
661
|
-
label: string;
|
|
662
|
-
} & Omit<HTMLElementProps<HTMLInputElement>, "type"> & react.RefAttributes<HTMLInputElement>>;
|
|
663
|
-
|
|
664
|
-
declare function useComponentStyles<T extends keyof ThemeComponentsProps>(name: T, props: ThemeComponentsProps[T], useDefaultVariants?: boolean): string;
|
|
709
|
+
declare function useComponentStyles<T extends keyof ComponentThemesProps>(name: T, props: ComponentThemesProps[T], useDefaultVariants?: boolean): string;
|
|
665
710
|
|
|
666
711
|
type ThemeComponentsStylesRequired = Required<ThemeComponentsStyles>;
|
|
667
712
|
type Components = {
|
|
668
713
|
[K in keyof ThemeComponentsStylesRequired]: ThemeComponentsStylesRequired[K] extends RecordLike ? Required<ThemeComponentsStylesRequired[K]>['defaultVariants'] extends RecordLike ? ThemeComponentsStylesRequired[K]['defaultVariants'] extends undefined ? never : Exclude<ThemeComponentsStylesRequired[K]['defaultVariants'], undefined> : never : never;
|
|
669
714
|
};
|
|
670
|
-
declare const useComponentStyleDefaultProps: <T extends keyof
|
|
715
|
+
declare const useComponentStyleDefaultProps: <T extends keyof ComponentThemes>(name: T) => Components[T];
|
|
671
716
|
|
|
672
717
|
type Args = null | undefined | boolean | string;
|
|
673
718
|
declare const classnames: (...args: Args[]) => string | undefined;
|
|
674
719
|
|
|
675
720
|
declare const momotaro: Theme;
|
|
676
721
|
|
|
677
|
-
export { BlocksProvider, BlocksProviderProps, Box, BoxProps, Button, ButtonProps, Dialog, DialogProps, Divider, DividerProps, Heading, HeadingProps, Inline, InlineProps, Input, InputProps, Link, LinkProps, Spinner, SpinnerProps, Stack, StackProps, Text, TextProps, ThemeComponentsStyles, ThemeTokens, atoms, breakpointQuery, classnames, makeComponentTheme, makeTheme, momotaro, useComponentStyleDefaultProps, useComponentStyles, vars };
|
|
722
|
+
export { BlocksProvider, BlocksProviderProps, Box, BoxProps, Button, ButtonProps, Dialog, DialogProps, Divider, DividerProps, Heading, HeadingProps, Inline, InlineProps, Input, InputProps, Label, LabelProps, Link, LinkProps, Spinner, SpinnerProps, Stack, StackProps, Text, TextProps, ThemeComponentsStyles, ThemeTokens, atoms, breakpointQuery, classnames, makeComponentTheme, makeTheme, momotaro, useComponentStyleDefaultProps, useComponentStyles, vars };
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
3
3
|
const css = require("@vanilla-extract/css");
|
|
4
4
|
const styles_lib_theme_makeComponentTheme_cjs = require("../../../lib/theme/makeComponentTheme.cjs");
|
|
5
|
-
const styles_themes_momotaro_components_helpers_css_cjs = require("./helpers.css.cjs");
|
|
6
5
|
const styles_lib_theme_vars_css_cjs = require("../../../lib/theme/vars.css.cjs");
|
|
6
|
+
const styles_themes_momotaro_components_helpers_css_cjs = require("./helpers.css.cjs");
|
|
7
7
|
const styles_lib_css_atoms_sprinkles_css_cjs = require("../../../lib/css/atoms/sprinkles.css.cjs");
|
|
8
8
|
fileScope.setFileScope("src/themes/momotaro/components/button.css.ts?used", "blocks");
|
|
9
9
|
const primaryColor = css.createVar("primaryColor");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
|
|
2
2
|
import { createVar, style } from "@vanilla-extract/css";
|
|
3
3
|
import { makeComponentTheme } from "../../../lib/theme/makeComponentTheme.mjs";
|
|
4
|
-
import { clickable } from "./helpers.css.mjs";
|
|
5
4
|
import { vars } from "../../../lib/theme/vars.css.mjs";
|
|
5
|
+
import { clickable } from "./helpers.css.mjs";
|
|
6
6
|
import { atoms } from "../../../lib/css/atoms/sprinkles.css.mjs";
|
|
7
7
|
setFileScope("src/themes/momotaro/components/button.css.ts?used", "blocks");
|
|
8
8
|
const primaryColor = createVar("primaryColor");
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
3
|
+
const css = require("@vanilla-extract/css");
|
|
4
|
+
const styles_lib_theme_makeComponentTheme_cjs = require("../../../lib/theme/makeComponentTheme.cjs");
|
|
5
|
+
const styles_lib_theme_vars_css_cjs = require("../../../lib/theme/vars.css.cjs");
|
|
6
|
+
const styles_themes_momotaro_components_helpers_css_cjs = require("./helpers.css.cjs");
|
|
7
|
+
const styles_themes_momotaro_components_transitions_cjs = require("./transitions.cjs");
|
|
8
|
+
const styles_lib_css_atoms_sprinkles_css_cjs = require("../../../lib/css/atoms/sprinkles.css.cjs");
|
|
9
|
+
fileScope.setFileScope("src/themes/momotaro/components/checkbox.css.ts?used", "blocks");
|
|
10
|
+
const checkbox = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("checkbox", {
|
|
11
|
+
base: css.style([{
|
|
12
|
+
display: "flex",
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
justifyContent: "center",
|
|
15
|
+
width: 24,
|
|
16
|
+
height: 24,
|
|
17
|
+
transition: `transform ${styles_lib_theme_vars_css_cjs.vars.transition.fast}`,
|
|
18
|
+
transitionProperty: "background-color",
|
|
19
|
+
":hover": {
|
|
20
|
+
backgroundColor: styles_lib_theme_vars_css_cjs.vars.color.primaryDark
|
|
21
|
+
},
|
|
22
|
+
selectors: {
|
|
23
|
+
"&:has(input:checked):not(:hover)": {
|
|
24
|
+
backgroundColor: styles_lib_theme_vars_css_cjs.vars.color.primary
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}, styles_lib_css_atoms_sprinkles_css_cjs.atoms({
|
|
28
|
+
backgroundColor: "primaryLight",
|
|
29
|
+
borderRadius: "small"
|
|
30
|
+
}), styles_themes_momotaro_components_helpers_css_cjs.focusable], "checkbox_base"),
|
|
31
|
+
icon: css.style({
|
|
32
|
+
height: 12,
|
|
33
|
+
width: 12,
|
|
34
|
+
backgroundColor: "white",
|
|
35
|
+
borderRadius: "8px",
|
|
36
|
+
transform: "scale(0)",
|
|
37
|
+
transition: `transform ${styles_lib_theme_vars_css_cjs.vars.transition.normal} ${styles_themes_momotaro_components_transitions_cjs.bounceOut}`,
|
|
38
|
+
selectors: {
|
|
39
|
+
"input:checked ~ &": {
|
|
40
|
+
transform: "scale(1)"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}, "checkbox_icon"),
|
|
44
|
+
label: styles_lib_css_atoms_sprinkles_css_cjs.atoms({
|
|
45
|
+
display: "flex",
|
|
46
|
+
flexDirection: "row",
|
|
47
|
+
padding: "xsmall",
|
|
48
|
+
gap: "medium",
|
|
49
|
+
cursor: "pointer"
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
fileScope.endFileScope();
|
|
53
|
+
exports.checkbox = checkbox;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
|
|
2
|
+
import { style } from "@vanilla-extract/css";
|
|
3
|
+
import { makeComponentTheme } from "../../../lib/theme/makeComponentTheme.mjs";
|
|
4
|
+
import { vars } from "../../../lib/theme/vars.css.mjs";
|
|
5
|
+
import { focusable } from "./helpers.css.mjs";
|
|
6
|
+
import { bounceOut } from "./transitions.mjs";
|
|
7
|
+
import { atoms } from "../../../lib/css/atoms/sprinkles.css.mjs";
|
|
8
|
+
setFileScope("src/themes/momotaro/components/checkbox.css.ts?used", "blocks");
|
|
9
|
+
const checkbox = makeComponentTheme("checkbox", {
|
|
10
|
+
base: style([{
|
|
11
|
+
display: "flex",
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
justifyContent: "center",
|
|
14
|
+
width: 24,
|
|
15
|
+
height: 24,
|
|
16
|
+
transition: `transform ${vars.transition.fast}`,
|
|
17
|
+
transitionProperty: "background-color",
|
|
18
|
+
":hover": {
|
|
19
|
+
backgroundColor: vars.color.primaryDark
|
|
20
|
+
},
|
|
21
|
+
selectors: {
|
|
22
|
+
"&:has(input:checked):not(:hover)": {
|
|
23
|
+
backgroundColor: vars.color.primary
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}, atoms({
|
|
27
|
+
backgroundColor: "primaryLight",
|
|
28
|
+
borderRadius: "small"
|
|
29
|
+
}), focusable], "checkbox_base"),
|
|
30
|
+
icon: style({
|
|
31
|
+
height: 12,
|
|
32
|
+
width: 12,
|
|
33
|
+
backgroundColor: "white",
|
|
34
|
+
borderRadius: "8px",
|
|
35
|
+
transform: "scale(0)",
|
|
36
|
+
transition: `transform ${vars.transition.normal} ${bounceOut}`,
|
|
37
|
+
selectors: {
|
|
38
|
+
"input:checked ~ &": {
|
|
39
|
+
transform: "scale(1)"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}, "checkbox_icon"),
|
|
43
|
+
label: atoms({
|
|
44
|
+
display: "flex",
|
|
45
|
+
flexDirection: "row",
|
|
46
|
+
padding: "xsmall",
|
|
47
|
+
gap: "medium",
|
|
48
|
+
cursor: "pointer"
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
endFileScope();
|
|
52
|
+
export {
|
|
53
|
+
checkbox
|
|
54
|
+
};
|
|
@@ -14,6 +14,19 @@ const focusable = css.style({
|
|
|
14
14
|
":disabled": {
|
|
15
15
|
opacity: 0.5,
|
|
16
16
|
cursor: "auto"
|
|
17
|
+
},
|
|
18
|
+
selectors: {
|
|
19
|
+
"&:has(input:focus-visible)": {
|
|
20
|
+
outline: "2px solid transparent",
|
|
21
|
+
outlineOffset: "2px",
|
|
22
|
+
boxShadow: styles_lib_theme_vars_css_cjs.vars.focus.boxShadow,
|
|
23
|
+
transitionDuration: styles_lib_theme_vars_css_cjs.vars.transition.fast,
|
|
24
|
+
transitionProperty: "box-shadow"
|
|
25
|
+
},
|
|
26
|
+
"&:has(input:disabled)": {
|
|
27
|
+
opacity: 0.5,
|
|
28
|
+
cursor: "auto"
|
|
29
|
+
}
|
|
17
30
|
}
|
|
18
31
|
}, "focusable");
|
|
19
32
|
const clickable = css.style([focusable, {
|
|
@@ -13,6 +13,19 @@ const focusable = style({
|
|
|
13
13
|
":disabled": {
|
|
14
14
|
opacity: 0.5,
|
|
15
15
|
cursor: "auto"
|
|
16
|
+
},
|
|
17
|
+
selectors: {
|
|
18
|
+
"&:has(input:focus-visible)": {
|
|
19
|
+
outline: "2px solid transparent",
|
|
20
|
+
outlineOffset: "2px",
|
|
21
|
+
boxShadow: vars.focus.boxShadow,
|
|
22
|
+
transitionDuration: vars.transition.fast,
|
|
23
|
+
transitionProperty: "box-shadow"
|
|
24
|
+
},
|
|
25
|
+
"&:has(input:disabled)": {
|
|
26
|
+
opacity: 0.5,
|
|
27
|
+
cursor: "auto"
|
|
28
|
+
}
|
|
16
29
|
}
|
|
17
30
|
}, "focusable");
|
|
18
31
|
const clickable = style([focusable, {
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const styles_themes_momotaro_components_button_css_cjs = require("./button.css.cjs");
|
|
3
|
+
const styles_themes_momotaro_components_checkbox_css_cjs = require("./checkbox.css.cjs");
|
|
3
4
|
const styles_themes_momotaro_components_dialog_css_cjs = require("./dialog.css.cjs");
|
|
4
5
|
const styles_themes_momotaro_components_divider_css_cjs = require("./divider.css.cjs");
|
|
5
6
|
const styles_themes_momotaro_components_input_css_cjs = require("./input.css.cjs");
|
|
7
|
+
const styles_themes_momotaro_components_label_css_cjs = require("./label.css.cjs");
|
|
6
8
|
const styles_themes_momotaro_components_link_css_cjs = require("./link.css.cjs");
|
|
9
|
+
const styles_themes_momotaro_components_radio_css_cjs = require("./radio.css.cjs");
|
|
7
10
|
const styles_themes_momotaro_components_spinner_css_cjs = require("./spinner.css.cjs");
|
|
8
11
|
const components = {
|
|
9
12
|
button: styles_themes_momotaro_components_button_css_cjs.button,
|
|
@@ -11,6 +14,9 @@ const components = {
|
|
|
11
14
|
spinner: styles_themes_momotaro_components_spinner_css_cjs.spinner,
|
|
12
15
|
divider: styles_themes_momotaro_components_divider_css_cjs.divider,
|
|
13
16
|
dialog: styles_themes_momotaro_components_dialog_css_cjs.dialog,
|
|
14
|
-
input: styles_themes_momotaro_components_input_css_cjs.input
|
|
17
|
+
input: styles_themes_momotaro_components_input_css_cjs.input,
|
|
18
|
+
checkbox: styles_themes_momotaro_components_checkbox_css_cjs.checkbox,
|
|
19
|
+
radio: styles_themes_momotaro_components_radio_css_cjs.radio,
|
|
20
|
+
label: styles_themes_momotaro_components_label_css_cjs.label
|
|
15
21
|
};
|
|
16
22
|
exports.components = components;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { button } from "./button.css.mjs";
|
|
2
|
+
import { checkbox } from "./checkbox.css.mjs";
|
|
2
3
|
import { dialog } from "./dialog.css.mjs";
|
|
3
4
|
import { divider } from "./divider.css.mjs";
|
|
4
5
|
import { input } from "./input.css.mjs";
|
|
6
|
+
import { label } from "./label.css.mjs";
|
|
5
7
|
import { link } from "./link.css.mjs";
|
|
8
|
+
import { radio } from "./radio.css.mjs";
|
|
6
9
|
import { spinner } from "./spinner.css.mjs";
|
|
7
10
|
const components = {
|
|
8
11
|
button,
|
|
@@ -10,7 +13,10 @@ const components = {
|
|
|
10
13
|
spinner,
|
|
11
14
|
divider,
|
|
12
15
|
dialog,
|
|
13
|
-
input
|
|
16
|
+
input,
|
|
17
|
+
checkbox,
|
|
18
|
+
radio,
|
|
19
|
+
label
|
|
14
20
|
};
|
|
15
21
|
export {
|
|
16
22
|
components
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
3
3
|
const css = require("@vanilla-extract/css");
|
|
4
|
-
const styles_themes_momotaro_components_helpers_css_cjs = require("./helpers.css.cjs");
|
|
5
4
|
const styles_lib_theme_makeComponentTheme_cjs = require("../../../lib/theme/makeComponentTheme.cjs");
|
|
6
5
|
const styles_lib_theme_vars_css_cjs = require("../../../lib/theme/vars.css.cjs");
|
|
7
6
|
const styles_lib_css_atoms_sprinkles_css_cjs = require("../../../lib/css/atoms/sprinkles.css.cjs");
|
|
@@ -18,7 +17,8 @@ const input = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("input"
|
|
|
18
17
|
background: "transparent",
|
|
19
18
|
"::placeholder": {
|
|
20
19
|
color: styles_lib_theme_vars_css_cjs.vars.color.textLight
|
|
21
|
-
}
|
|
20
|
+
},
|
|
21
|
+
":disabled": {}
|
|
22
22
|
}], "input_input"),
|
|
23
23
|
container: css.style([{
|
|
24
24
|
minHeight: 56,
|
|
@@ -34,7 +34,7 @@ const input = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("input"
|
|
|
34
34
|
borderRadius: "medium",
|
|
35
35
|
boxShadow: "medium",
|
|
36
36
|
gap: "large"
|
|
37
|
-
})
|
|
37
|
+
})], "input_container")
|
|
38
38
|
});
|
|
39
39
|
fileScope.endFileScope();
|
|
40
40
|
exports.input = input;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
|
|
2
2
|
import { style } from "@vanilla-extract/css";
|
|
3
|
-
import { focusable } from "./helpers.css.mjs";
|
|
4
3
|
import { makeComponentTheme } from "../../../lib/theme/makeComponentTheme.mjs";
|
|
5
4
|
import { vars } from "../../../lib/theme/vars.css.mjs";
|
|
6
5
|
import { atoms } from "../../../lib/css/atoms/sprinkles.css.mjs";
|
|
@@ -17,7 +16,8 @@ const input = makeComponentTheme("input", {
|
|
|
17
16
|
background: "transparent",
|
|
18
17
|
"::placeholder": {
|
|
19
18
|
color: vars.color.textLight
|
|
20
|
-
}
|
|
19
|
+
},
|
|
20
|
+
":disabled": {}
|
|
21
21
|
}], "input_input"),
|
|
22
22
|
container: style([{
|
|
23
23
|
minHeight: 56,
|
|
@@ -33,7 +33,7 @@ const input = makeComponentTheme("input", {
|
|
|
33
33
|
borderRadius: "medium",
|
|
34
34
|
boxShadow: "medium",
|
|
35
35
|
gap: "large"
|
|
36
|
-
})
|
|
36
|
+
})], "input_container")
|
|
37
37
|
});
|
|
38
38
|
endFileScope();
|
|
39
39
|
export {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
3
|
+
const css = require("@vanilla-extract/css");
|
|
4
|
+
const styles_lib_theme_makeComponentTheme_cjs = require("../../../lib/theme/makeComponentTheme.cjs");
|
|
5
|
+
const styles_lib_theme_vars_css_cjs = require("../../../lib/theme/vars.css.cjs");
|
|
6
|
+
fileScope.setFileScope("src/themes/momotaro/components/label.css.ts?used", "blocks");
|
|
7
|
+
const label = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("label", {
|
|
8
|
+
base: css.style({}, "label_base"),
|
|
9
|
+
variants: {
|
|
10
|
+
size: {
|
|
11
|
+
small: css.style({
|
|
12
|
+
fontSize: styles_lib_theme_vars_css_cjs.vars.fontSize.xsmall
|
|
13
|
+
}, "label_variants_size_small"),
|
|
14
|
+
medium: css.style({
|
|
15
|
+
fontSize: styles_lib_theme_vars_css_cjs.vars.fontSize.small
|
|
16
|
+
}, "label_variants_size_medium"),
|
|
17
|
+
large: css.style({
|
|
18
|
+
fontSize: styles_lib_theme_vars_css_cjs.vars.fontSize.medium
|
|
19
|
+
}, "label_variants_size_large")
|
|
20
|
+
},
|
|
21
|
+
required: css.style({
|
|
22
|
+
":after": {
|
|
23
|
+
content: '"*"',
|
|
24
|
+
marginLeft: styles_lib_theme_vars_css_cjs.vars.space.xsmall
|
|
25
|
+
}
|
|
26
|
+
}, "label_variants_required")
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: {
|
|
29
|
+
size: "large"
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
fileScope.endFileScope();
|
|
33
|
+
exports.label = label;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
|
|
2
|
+
import { style } from "@vanilla-extract/css";
|
|
3
|
+
import { makeComponentTheme } from "../../../lib/theme/makeComponentTheme.mjs";
|
|
4
|
+
import { vars } from "../../../lib/theme/vars.css.mjs";
|
|
5
|
+
setFileScope("src/themes/momotaro/components/label.css.ts?used", "blocks");
|
|
6
|
+
const label = makeComponentTheme("label", {
|
|
7
|
+
base: style({}, "label_base"),
|
|
8
|
+
variants: {
|
|
9
|
+
size: {
|
|
10
|
+
small: style({
|
|
11
|
+
fontSize: vars.fontSize.xsmall
|
|
12
|
+
}, "label_variants_size_small"),
|
|
13
|
+
medium: style({
|
|
14
|
+
fontSize: vars.fontSize.small
|
|
15
|
+
}, "label_variants_size_medium"),
|
|
16
|
+
large: style({
|
|
17
|
+
fontSize: vars.fontSize.medium
|
|
18
|
+
}, "label_variants_size_large")
|
|
19
|
+
},
|
|
20
|
+
required: style({
|
|
21
|
+
":after": {
|
|
22
|
+
content: '"*"',
|
|
23
|
+
marginLeft: vars.space.xsmall
|
|
24
|
+
}
|
|
25
|
+
}, "label_variants_required")
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
size: "large"
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
endFileScope();
|
|
32
|
+
export {
|
|
33
|
+
label
|
|
34
|
+
};
|