@latte-macchiat-io/latte-vanilla-components 0.0.175 → 0.0.177
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 +12 -23
- package/src/assets/styles/default-theme.ts +312 -0
- package/src/components/Button/stories.ts +127 -0
- package/src/components/Columns/stories.ts +35 -0
- package/src/components/Icon/path.ts +36 -0
- package/src/components/Icon/stories.ts +29 -0
- package/src/components/Main/stories.ts +33 -0
- package/src/components/Section/stories.ts +64 -0
- package/{dist/types/index.d.ts → src/index.ts} +38 -0
- package/src/styles/mediaqueries.ts +17 -0
- package/src/theme/baseThemeValues.ts +160 -0
- package/src/theme/index.ts +6 -0
- package/src/theme/utils.ts +76 -0
- package/src/types/theme.ts +295 -0
- package/src/types/withClassName.ts +3 -0
- package/src/utils/cookie.ts +24 -0
- package/src/utils/deep-merge-objects.ts +15 -0
- package/src/utils/use-breakpoint-key.ts +30 -0
- package/src/utils/use-window-size.ts +37 -0
- package/dist/components/Actions/Actions.css.ts +0 -113
- package/dist/components/Button/Button.css.ts +0 -119
- package/dist/components/Carousel/Carousel.css.ts +0 -179
- package/dist/components/Columns/Columns.css.ts +0 -185
- package/dist/components/ConsentCookie/ConsentCookie.css.ts +0 -167
- package/dist/components/Footer/Footer.css.ts +0 -108
- package/dist/components/Form/Form.css.ts +0 -64
- package/dist/components/Form/Row/Row.css.ts +0 -70
- package/dist/components/Form/TextField/Input/Input.css.ts +0 -106
- package/dist/components/Form/TextField/Label/Label.css.ts +0 -58
- package/dist/components/Form/TextField/TextField.css.ts +0 -139
- package/dist/components/Form/TextField/Textarea/Textarea.css.ts +0 -121
- package/dist/components/Header/Header.css.ts +0 -111
- package/dist/components/Header/HeaderOverlay/styles.css.ts +0 -33
- package/dist/components/Header/ToggleNav/styles.css.ts +0 -40
- package/dist/components/Icon/Icon.css.ts +0 -102
- package/dist/components/KeyNumber/KeyNumber.css.ts +0 -158
- package/dist/components/LanguageSwitcher/LanguageSwitcher.css.ts +0 -120
- package/dist/components/Logo/Logo.css.ts +0 -98
- package/dist/components/Main/Main.css.ts +0 -62
- package/dist/components/Modal/Modal.css.ts +0 -203
- package/dist/components/Nav/Nav.css.ts +0 -123
- package/dist/components/NavLegal/NavLegal.css.ts +0 -121
- package/dist/components/NavSocial/NavSocial.css.ts +0 -121
- package/dist/components/Section/Section.css.ts +0 -101
- package/dist/components/Video/Video.css.ts +0 -210
- package/dist/components/VideoFullWidth/VideoFullWidth.css.ts +0 -50
- package/dist/index.cjs.js +0 -2
- package/dist/index.es.js +0 -6813
- package/dist/styles/sprinkles.css.ts +0 -84
- package/dist/theme/contract.css.ts +0 -83
- package/dist/types/components/Actions/Actions.css.d.ts +0 -74
- package/dist/types/components/Actions/Actions.d.ts +0 -7
- package/dist/types/components/Actions/export.d.ts +0 -0
- package/dist/types/components/Actions/stories.d.ts +0 -0
- package/dist/types/components/Button/Button.css.d.ts +0 -65
- package/dist/types/components/Button/Button.d.ts +0 -8
- package/dist/types/components/Button/export.d.ts +0 -0
- package/dist/types/components/Button/stories.d.ts +0 -0
- package/dist/types/components/Carousel/Carousel.css.d.ts +0 -33
- package/dist/types/components/Carousel/Carousel.d.ts +0 -15
- package/dist/types/components/Carousel/export.d.ts +0 -0
- package/dist/types/components/Columns/Columns.css.d.ts +0 -104
- package/dist/types/components/Columns/Columns.d.ts +0 -8
- package/dist/types/components/Columns/export.d.ts +0 -0
- package/dist/types/components/Columns/stories.d.ts +0 -0
- package/dist/types/components/ConsentCookie/ConsentCookie.css.d.ts +0 -15
- package/dist/types/components/ConsentCookie/ConsentCookie.d.ts +0 -17
- package/dist/types/components/ConsentCookie/export.d.ts +0 -0
- package/dist/types/components/ConsentCookie/stories.d.ts +0 -0
- package/dist/types/components/Footer/Footer.css.d.ts +0 -50
- package/dist/types/components/Footer/Footer.d.ts +0 -7
- package/dist/types/components/Footer/export.d.ts +0 -0
- package/dist/types/components/Footer/stories.d.ts +0 -6
- package/dist/types/components/Form/Form.css.d.ts +0 -46
- package/dist/types/components/Form/Form.d.ts +0 -7
- package/dist/types/components/Form/Row/Row.css.d.ts +0 -51
- package/dist/types/components/Form/Row/Row.d.ts +0 -9
- package/dist/types/components/Form/Row/index.d.ts +0 -0
- package/dist/types/components/Form/Row/stories.d.ts +0 -0
- package/dist/types/components/Form/TextField/Input/Input.css.d.ts +0 -32
- package/dist/types/components/Form/TextField/Input/Input.d.ts +0 -10
- package/dist/types/components/Form/TextField/Input/export.d.ts +0 -0
- package/dist/types/components/Form/TextField/Label/Label.css.d.ts +0 -23
- package/dist/types/components/Form/TextField/Label/Label.d.ts +0 -9
- package/dist/types/components/Form/TextField/Label/export.d.ts +0 -0
- package/dist/types/components/Form/TextField/TextField.css.d.ts +0 -19
- package/dist/types/components/Form/TextField/TextField.d.ts +0 -21
- package/dist/types/components/Form/TextField/Textarea/Textarea.css.d.ts +0 -56
- package/dist/types/components/Form/TextField/Textarea/Textarea.d.ts +0 -8
- package/dist/types/components/Form/TextField/Textarea/export.d.ts +0 -0
- package/dist/types/components/Form/TextField/Textarea/stories.d.ts +0 -0
- package/dist/types/components/Form/TextField/export.d.ts +0 -0
- package/dist/types/components/Form/export.d.ts +0 -0
- package/dist/types/components/Header/Header.css.d.ts +0 -36
- package/dist/types/components/Header/Header.d.ts +0 -11
- package/dist/types/components/Header/HeaderOverlay/index.d.ts +0 -7
- package/dist/types/components/Header/HeaderOverlay/styles.css.d.ts +0 -5
- package/dist/types/components/Header/ToggleNav/index.d.ts +0 -9
- package/dist/types/components/Header/ToggleNav/styles.css.d.ts +0 -5
- package/dist/types/components/Header/export.d.ts +0 -0
- package/dist/types/components/Header/stories.d.ts +0 -6
- package/dist/types/components/Icon/Icon.css.d.ts +0 -45
- package/dist/types/components/Icon/Icon.d.ts +0 -12
- package/dist/types/components/Icon/export.d.ts +0 -0
- package/dist/types/components/Icon/path.d.ts +0 -19
- package/dist/types/components/Icon/stories.d.ts +0 -0
- package/dist/types/components/KeyNumber/KeyNumber.css.d.ts +0 -40
- package/dist/types/components/KeyNumber/KeyNumber.d.ts +0 -15
- package/dist/types/components/KeyNumber/export.d.ts +0 -0
- package/dist/types/components/LanguageSwitcher/LanguageSwitcher.css.d.ts +0 -18
- package/dist/types/components/LanguageSwitcher/LanguageSwitcher.d.ts +0 -16
- package/dist/types/components/LanguageSwitcher/export.d.ts +0 -0
- package/dist/types/components/Logo/Logo.css.d.ts +0 -54
- package/dist/types/components/Logo/Logo.d.ts +0 -8
- package/dist/types/components/Logo/export.d.ts +0 -0
- package/dist/types/components/Logo/stories.d.ts +0 -6
- package/dist/types/components/Main/Main.css.d.ts +0 -32
- package/dist/types/components/Main/Main.d.ts +0 -7
- package/dist/types/components/Main/export.d.ts +0 -0
- package/dist/types/components/Main/stories.d.ts +0 -0
- package/dist/types/components/Modal/Modal.css.d.ts +0 -82
- package/dist/types/components/Modal/Modal.d.ts +0 -15
- package/dist/types/components/Modal/export.d.ts +0 -0
- package/dist/types/components/Modal/types.d.ts +0 -5
- package/dist/types/components/Nav/Nav.css.d.ts +0 -52
- package/dist/types/components/Nav/Nav.d.ts +0 -7
- package/dist/types/components/Nav/export.d.ts +0 -0
- package/dist/types/components/Nav/stories.d.ts +0 -6
- package/dist/types/components/NavLegal/NavLegal.css.d.ts +0 -57
- package/dist/types/components/NavLegal/NavLegal.d.ts +0 -7
- package/dist/types/components/NavLegal/export.d.ts +0 -0
- package/dist/types/components/NavLegal/stories.d.ts +0 -6
- package/dist/types/components/NavLegal/types.d.ts +0 -1
- package/dist/types/components/NavSocial/NavSocial.css.d.ts +0 -30
- package/dist/types/components/NavSocial/NavSocial.d.ts +0 -15
- package/dist/types/components/NavSocial/export.d.ts +0 -0
- package/dist/types/components/NavSocial/stories.d.ts +0 -0
- package/dist/types/components/NavSocial/types.d.ts +0 -1
- package/dist/types/components/Section/Section.css.d.ts +0 -60
- package/dist/types/components/Section/Section.d.ts +0 -7
- package/dist/types/components/Section/export.d.ts +0 -0
- package/dist/types/components/Section/stories.d.ts +0 -0
- package/dist/types/components/ToRemove/ToRemove.d.ts +0 -1
- package/dist/types/components/Video/Video.css.d.ts +0 -43
- package/dist/types/components/Video/Video.d.ts +0 -17
- package/dist/types/components/Video/export.d.ts +0 -0
- package/dist/types/components/VideoFullWidth/VideoFullWidth.css.d.ts +0 -18
- package/dist/types/components/VideoFullWidth/VideoFullWidth.d.ts +0 -14
- package/dist/types/components/VideoFullWidth/export.d.ts +0 -0
- package/dist/types/utils/cookie.d.ts +0 -2
- package/dist/types/utils/deep-merge-objects.d.ts +0 -2
- package/dist/types/utils/theme.css.d.ts +0 -173
- package/dist/types/utils/use-breakpoint-key.d.ts +0 -1
- package/dist/types/utils/use-window-size.d.ts +0 -5
- package/dist/utils/theme.css.ts +0 -129
@@ -0,0 +1,64 @@
|
|
1
|
+
// import type { Meta, StoryObj } from '@storybook/react';
|
2
|
+
// import { defaultTheme } from '@assets/styles/default-theme';
|
3
|
+
// import { Section } from './Section';
|
4
|
+
// import { sectionStyle } from './styles.css';
|
5
|
+
// import { Align } from './types';
|
6
|
+
|
7
|
+
// // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
8
|
+
// const meta = {
|
9
|
+
// title: 'Latte Components / Layout / Section',
|
10
|
+
// component: Section,
|
11
|
+
// parameters: {
|
12
|
+
// // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
13
|
+
// layout: 'centered',
|
14
|
+
// },
|
15
|
+
// // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
16
|
+
// tags: ['autodocs'],
|
17
|
+
// // More on argTypes: https://storybook.js.org/docs/api/argtypes
|
18
|
+
// argTypes: {},
|
19
|
+
// // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
20
|
+
// } satisfies Meta<typeof Section>;
|
21
|
+
|
22
|
+
// export default meta;
|
23
|
+
// type Story = StoryObj<typeof meta>;
|
24
|
+
|
25
|
+
// // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
26
|
+
// export const Default: Story = {
|
27
|
+
// args: {
|
28
|
+
// theme: defaultTheme,
|
29
|
+
// className: sectionStyle,
|
30
|
+
// children:
|
31
|
+
// 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
|
32
|
+
// },
|
33
|
+
// };
|
34
|
+
|
35
|
+
// export const FullHeight: Story = {
|
36
|
+
// args: {
|
37
|
+
// isFullHeight: true,
|
38
|
+
// theme: defaultTheme,
|
39
|
+
// className: sectionStyle,
|
40
|
+
// children:
|
41
|
+
// 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
|
42
|
+
// },
|
43
|
+
// };
|
44
|
+
|
45
|
+
// export const AlignCenter: Story = {
|
46
|
+
// args: {
|
47
|
+
// theme: defaultTheme,
|
48
|
+
// align: Align.Center,
|
49
|
+
// className: sectionStyle,
|
50
|
+
// children:
|
51
|
+
// 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
|
52
|
+
// },
|
53
|
+
// };
|
54
|
+
|
55
|
+
// export const BackgroundColor: Story = {
|
56
|
+
// args: {
|
57
|
+
// isDark: true,
|
58
|
+
// theme: defaultTheme,
|
59
|
+
// backgroundColor: 'red',
|
60
|
+
// className: sectionStyle,
|
61
|
+
// children:
|
62
|
+
// 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
|
63
|
+
// },
|
64
|
+
// };
|
@@ -1,58 +1,96 @@
|
|
1
|
+
// Theme system - Import this first to apply global styles
|
1
2
|
export * from './theme';
|
3
|
+
|
4
|
+
// Styles utilities
|
2
5
|
export { sprinkles, responsiveProperties, type Sprinkles } from './styles/sprinkles.css';
|
3
6
|
export { breakpoints, queries } from './styles/mediaqueries';
|
7
|
+
|
8
|
+
// Vanilla Extract Components (fully migrated)
|
4
9
|
export { Button, type ButtonProps } from './components/Button/Button';
|
5
10
|
export { type ButtonVariants } from './components/Button/Button.css';
|
11
|
+
|
6
12
|
export { Section, type SectionProps } from './components/Section/Section';
|
7
13
|
export { type SectionVariants } from './components/Section/Section.css';
|
14
|
+
|
8
15
|
export { Main, type MainProps } from './components/Main/Main';
|
9
16
|
export { type MainVariants } from './components/Main/Main.css';
|
17
|
+
|
10
18
|
export { Header, type HeaderProps } from './components/Header/Header';
|
11
19
|
export { type HeaderVariants } from './components/Header/Header.css';
|
20
|
+
|
12
21
|
export { Footer, type FooterProps } from './components/Footer/Footer';
|
13
22
|
export { type FooterVariants } from './components/Footer/Footer.css';
|
23
|
+
|
14
24
|
export { Nav, type NavProps } from './components/Nav/Nav';
|
15
25
|
export { type NavVariants } from './components/Nav/Nav.css';
|
26
|
+
|
16
27
|
export { Icon, type IconProps } from './components/Icon/Icon';
|
17
28
|
export { type IconVariants } from './components/Icon/Icon.css';
|
29
|
+
|
18
30
|
export { Modal, type ModalProps } from './components/Modal/Modal';
|
19
31
|
export { type ModalVariants } from './components/Modal/Modal.css';
|
32
|
+
|
20
33
|
export { Logo, type LogoProps } from './components/Logo/Logo';
|
21
34
|
export { type LogoVariants } from './components/Logo/Logo.css';
|
35
|
+
|
22
36
|
export { Columns, type ColumnsProps } from './components/Columns/Columns';
|
23
37
|
export { type ColumnsVariants } from './components/Columns/Columns.css';
|
38
|
+
|
24
39
|
export { Actions, type ActionsProps } from './components/Actions/Actions';
|
25
40
|
export { type ActionsVariants } from './components/Actions/Actions.css';
|
41
|
+
|
26
42
|
export { Carousel, type CarouselProps } from './components/Carousel/Carousel';
|
27
43
|
export { type CarouselVariants } from './components/Carousel/Carousel.css';
|
44
|
+
|
28
45
|
export { ConsentCookie, type ConsentCookieProps } from './components/ConsentCookie/ConsentCookie';
|
29
46
|
export { type ConsentCookieVariants } from './components/ConsentCookie/ConsentCookie.css';
|
47
|
+
|
30
48
|
export { KeyNumber, type KeyNumberProps } from './components/KeyNumber/KeyNumber';
|
31
49
|
export { type KeyNumberVariants } from './components/KeyNumber/KeyNumber.css';
|
50
|
+
|
32
51
|
export { NavSocial, type NavSocialProps, type SocialNetwork, type SocialLink } from './components/NavSocial/NavSocial';
|
33
52
|
export { type NavSocialVariants } from './components/NavSocial/NavSocial.css';
|
53
|
+
|
34
54
|
export { NavLegal, type NavLegalProps } from './components/NavLegal/NavLegal';
|
35
55
|
export { type NavLegalVariants } from './components/NavLegal/NavLegal.css';
|
56
|
+
|
36
57
|
export { LanguageSwitcher, type LanguageSwitcherProps, type Locale } from './components/LanguageSwitcher/LanguageSwitcher';
|
37
58
|
export { type LanguageSwitcherVariants } from './components/LanguageSwitcher/LanguageSwitcher.css';
|
59
|
+
|
60
|
+
// Video Components
|
38
61
|
export { Video, type VideoProps } from './components/Video/Video';
|
39
62
|
export { type VideoVariants } from './components/Video/Video.css';
|
63
|
+
|
40
64
|
export { VideoFullWidth, type VideoFullWidthProps } from './components/VideoFullWidth/VideoFullWidth';
|
41
65
|
export { type VideoFullWidthVariants } from './components/VideoFullWidth/VideoFullWidth.css';
|
66
|
+
|
67
|
+
// Form Components
|
42
68
|
export { Form, type FormProps } from './components/Form/Form';
|
43
69
|
export { type FormVariants } from './components/Form/Form.css';
|
70
|
+
|
44
71
|
export { Row, type RowProps } from './components/Form/Row/Row';
|
45
72
|
export { type RowVariants } from './components/Form/Row/Row.css';
|
73
|
+
|
46
74
|
export { TextField, type TextFieldProps, type InputType } from './components/Form/TextField/TextField';
|
47
75
|
export { type TextFieldVariants } from './components/Form/TextField/TextField.css';
|
76
|
+
|
77
|
+
// Form TextField Subcomponents
|
48
78
|
export { Label, type LabelProps } from './components/Form/TextField/Label/Label';
|
49
79
|
export { type LabelVariants } from './components/Form/TextField/Label/Label.css';
|
80
|
+
|
50
81
|
export { Input, type InputProps, type InputType as InputFieldType } from './components/Form/TextField/Input/Input';
|
51
82
|
export { type InputVariants } from './components/Form/TextField/Input/Input.css';
|
83
|
+
|
52
84
|
export { Textarea, type TextareaProps } from './components/Form/TextField/Textarea/Textarea';
|
53
85
|
export { type TextareaVariants } from './components/Form/TextField/Textarea/Textarea.css';
|
86
|
+
|
54
87
|
export { ToRemove } from './components/ToRemove/ToRemove';
|
88
|
+
|
89
|
+
// Theme utilities
|
55
90
|
export { createDarkTheme, createLightTheme, type ThemeOverrides } from './utils/theme.css';
|
91
|
+
// Theme contract and values
|
56
92
|
export { themeContract } from './theme/contract.css';
|
57
93
|
export { baseLightTheme, baseDarkTheme } from './theme/baseThemeValues';
|
94
|
+
|
95
|
+
// Theme utilities
|
58
96
|
export { createThemeOverride, getThemeContract, getThemeValues, toggleTheme, setTheme, getCurrentTheme, type ThemeValues } from './theme/utils';
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export const breakpoints = {
|
2
|
+
mobile: 0,
|
3
|
+
sm: 640,
|
4
|
+
md: 768,
|
5
|
+
lg: 1024,
|
6
|
+
xl: 1280,
|
7
|
+
'2xl': 1536,
|
8
|
+
} as const;
|
9
|
+
|
10
|
+
export const queries = {
|
11
|
+
mobile: `screen and (min-width: ${breakpoints.mobile}px)`,
|
12
|
+
sm: `screen and (min-width: ${breakpoints.sm}px)`,
|
13
|
+
md: `screen and (min-width: ${breakpoints.md}px)`,
|
14
|
+
lg: `screen and (min-width: ${breakpoints.lg}px)`,
|
15
|
+
xl: `screen and (min-width: ${breakpoints.xl}px)`,
|
16
|
+
'2xl': `screen and (min-width: ${breakpoints['2xl']}px)`,
|
17
|
+
};
|
@@ -0,0 +1,160 @@
|
|
1
|
+
// Base theme values that can be imported and extended by apps
|
2
|
+
export const baseLightTheme = {
|
3
|
+
colors: {
|
4
|
+
primary: '#FF7377',
|
5
|
+
secondary: '#FCEFE6',
|
6
|
+
accent: '#FF7377',
|
7
|
+
background: '#ffffff',
|
8
|
+
surface: '#f8f9fa',
|
9
|
+
text: '#000000',
|
10
|
+
textSecondary: '#666666',
|
11
|
+
textLight: '#f5f5f5',
|
12
|
+
border: '#e1e1e1',
|
13
|
+
error: '#dc3545',
|
14
|
+
warning: '#ffc107',
|
15
|
+
success: '#28a745',
|
16
|
+
info: '#17a2b8',
|
17
|
+
},
|
18
|
+
space: {
|
19
|
+
none: '0px',
|
20
|
+
xs: '4px',
|
21
|
+
sm: '8px',
|
22
|
+
md: '16px',
|
23
|
+
lg: '32px',
|
24
|
+
xl: '64px',
|
25
|
+
'2xl': '128px',
|
26
|
+
},
|
27
|
+
radii: {
|
28
|
+
none: '0px',
|
29
|
+
sm: '4px',
|
30
|
+
md: '8px',
|
31
|
+
lg: '16px',
|
32
|
+
xl: '24px',
|
33
|
+
full: '9999px',
|
34
|
+
},
|
35
|
+
fonts: {
|
36
|
+
body: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
37
|
+
heading: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
38
|
+
mono: 'ui-monospace, SFMono-Regular, "SF Mono", Monaco, Consolas, monospace',
|
39
|
+
},
|
40
|
+
fontSizes: {
|
41
|
+
xs: '12px',
|
42
|
+
sm: '14px',
|
43
|
+
md: '16px',
|
44
|
+
lg: '18px',
|
45
|
+
xl: '20px',
|
46
|
+
'2xl': '24px',
|
47
|
+
'3xl': '32px',
|
48
|
+
'4xl': '40px',
|
49
|
+
},
|
50
|
+
fontWeights: {
|
51
|
+
light: '300',
|
52
|
+
normal: '400',
|
53
|
+
medium: '500',
|
54
|
+
semibold: '600',
|
55
|
+
bold: '700',
|
56
|
+
},
|
57
|
+
lineHeights: {
|
58
|
+
tight: '1.2',
|
59
|
+
normal: '1.5',
|
60
|
+
relaxed: '1.75',
|
61
|
+
},
|
62
|
+
shadows: {
|
63
|
+
none: 'none',
|
64
|
+
sm: '0 1px 2px rgba(0, 0, 0, 0.05)',
|
65
|
+
md: '0 4px 6px rgba(0, 0, 0, 0.1)',
|
66
|
+
lg: '0 10px 15px rgba(0, 0, 0, 0.1)',
|
67
|
+
xl: '0 20px 25px rgba(0, 0, 0, 0.1)',
|
68
|
+
},
|
69
|
+
maxWidth: '1500px',
|
70
|
+
section: {
|
71
|
+
paddingTop: '48px',
|
72
|
+
paddingBottom: '48px',
|
73
|
+
},
|
74
|
+
header: {
|
75
|
+
height: '80px',
|
76
|
+
},
|
77
|
+
footer: {
|
78
|
+
height: '80px',
|
79
|
+
},
|
80
|
+
};
|
81
|
+
|
82
|
+
export const baseDarkTheme = {
|
83
|
+
colors: {
|
84
|
+
primary: '#1a73e8',
|
85
|
+
secondary: '#374151',
|
86
|
+
accent: '#60a5fa',
|
87
|
+
background: '#111827',
|
88
|
+
surface: '#1f2937',
|
89
|
+
text: '#ffffff',
|
90
|
+
textSecondary: '#9ca3af',
|
91
|
+
textLight: '#f3f4f6',
|
92
|
+
border: '#374151',
|
93
|
+
error: '#ef4444',
|
94
|
+
warning: '#f59e0b',
|
95
|
+
success: '#10b981',
|
96
|
+
info: '#3b82f6',
|
97
|
+
},
|
98
|
+
space: {
|
99
|
+
none: '0px',
|
100
|
+
xs: '4px',
|
101
|
+
sm: '8px',
|
102
|
+
md: '16px',
|
103
|
+
lg: '32px',
|
104
|
+
xl: '64px',
|
105
|
+
'2xl': '128px',
|
106
|
+
},
|
107
|
+
radii: {
|
108
|
+
none: '0px',
|
109
|
+
sm: '4px',
|
110
|
+
md: '8px',
|
111
|
+
lg: '16px',
|
112
|
+
xl: '24px',
|
113
|
+
full: '9999px',
|
114
|
+
},
|
115
|
+
fonts: {
|
116
|
+
body: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
117
|
+
heading: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
118
|
+
mono: 'ui-monospace, SFMono-Regular, "SF Mono", Monaco, Consolas, monospace',
|
119
|
+
},
|
120
|
+
fontSizes: {
|
121
|
+
xs: '12px',
|
122
|
+
sm: '14px',
|
123
|
+
md: '16px',
|
124
|
+
lg: '18px',
|
125
|
+
xl: '20px',
|
126
|
+
'2xl': '24px',
|
127
|
+
'3xl': '32px',
|
128
|
+
'4xl': '40px',
|
129
|
+
},
|
130
|
+
fontWeights: {
|
131
|
+
light: '300',
|
132
|
+
normal: '400',
|
133
|
+
medium: '500',
|
134
|
+
semibold: '600',
|
135
|
+
bold: '700',
|
136
|
+
},
|
137
|
+
lineHeights: {
|
138
|
+
tight: '1.2',
|
139
|
+
normal: '1.5',
|
140
|
+
relaxed: '1.75',
|
141
|
+
},
|
142
|
+
shadows: {
|
143
|
+
none: 'none',
|
144
|
+
sm: '0 1px 2px rgba(0, 0, 0, 0.1)',
|
145
|
+
md: '0 4px 6px rgba(0, 0, 0, 0.15)',
|
146
|
+
lg: '0 10px 15px rgba(0, 0, 0, 0.2)',
|
147
|
+
xl: '0 20px 25px rgba(0, 0, 0, 0.25)',
|
148
|
+
},
|
149
|
+
maxWidth: '1500px',
|
150
|
+
section: {
|
151
|
+
paddingTop: '48px',
|
152
|
+
paddingBottom: '48px',
|
153
|
+
},
|
154
|
+
header: {
|
155
|
+
height: '80px',
|
156
|
+
},
|
157
|
+
footer: {
|
158
|
+
height: '80px',
|
159
|
+
},
|
160
|
+
};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
// Theme contract and values
|
2
|
+
export { themeContract } from './contract.css';
|
3
|
+
export { baseLightTheme, baseDarkTheme } from './baseThemeValues';
|
4
|
+
|
5
|
+
// Theme utilities
|
6
|
+
export { createThemeOverride, getThemeContract, getThemeValues, toggleTheme, setTheme, getCurrentTheme, type ThemeValues } from './utils';
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import { baseDarkTheme, baseLightTheme } from './baseThemeValues';
|
2
|
+
import { themeContract } from './contract.css';
|
3
|
+
|
4
|
+
export type ThemeValues = typeof baseLightTheme;
|
5
|
+
|
6
|
+
export const createThemeOverride = (overrides: Partial<ThemeValues>): ThemeValues => {
|
7
|
+
return {
|
8
|
+
...baseLightTheme,
|
9
|
+
...overrides,
|
10
|
+
colors: {
|
11
|
+
...baseLightTheme.colors,
|
12
|
+
...overrides.colors,
|
13
|
+
},
|
14
|
+
space: {
|
15
|
+
...baseLightTheme.space,
|
16
|
+
...overrides.space,
|
17
|
+
},
|
18
|
+
radii: {
|
19
|
+
...baseLightTheme.radii,
|
20
|
+
...overrides.radii,
|
21
|
+
},
|
22
|
+
fonts: {
|
23
|
+
...baseLightTheme.fonts,
|
24
|
+
...overrides.fonts,
|
25
|
+
},
|
26
|
+
fontSizes: {
|
27
|
+
...baseLightTheme.fontSizes,
|
28
|
+
...overrides.fontSizes,
|
29
|
+
},
|
30
|
+
lineHeights: {
|
31
|
+
...baseLightTheme.lineHeights,
|
32
|
+
...overrides.lineHeights,
|
33
|
+
},
|
34
|
+
shadows: {
|
35
|
+
...baseLightTheme.shadows,
|
36
|
+
...overrides.shadows,
|
37
|
+
},
|
38
|
+
};
|
39
|
+
};
|
40
|
+
|
41
|
+
export const getThemeContract = () => themeContract;
|
42
|
+
|
43
|
+
export const getThemeValues = (isDark = false): ThemeValues => {
|
44
|
+
return isDark ? baseDarkTheme : baseLightTheme;
|
45
|
+
};
|
46
|
+
|
47
|
+
export const toggleTheme = () => {
|
48
|
+
const html = document.documentElement;
|
49
|
+
const currentTheme = html.getAttribute('data-theme');
|
50
|
+
const newTheme = currentTheme === 'dark' ? null : 'dark';
|
51
|
+
|
52
|
+
if (newTheme) {
|
53
|
+
html.setAttribute('data-theme', newTheme);
|
54
|
+
} else {
|
55
|
+
html.removeAttribute('data-theme');
|
56
|
+
}
|
57
|
+
|
58
|
+
return newTheme === 'dark';
|
59
|
+
};
|
60
|
+
|
61
|
+
export const setTheme = (theme: 'light' | 'dark') => {
|
62
|
+
const html = document.documentElement;
|
63
|
+
|
64
|
+
if (theme === 'dark') {
|
65
|
+
html.setAttribute('data-theme', 'dark');
|
66
|
+
} else {
|
67
|
+
html.removeAttribute('data-theme');
|
68
|
+
}
|
69
|
+
};
|
70
|
+
|
71
|
+
export const getCurrentTheme = (): 'light' | 'dark' => {
|
72
|
+
if (typeof window === 'undefined') return 'light';
|
73
|
+
|
74
|
+
const html = document.documentElement;
|
75
|
+
return html.getAttribute('data-theme') === 'dark' ? 'dark' : 'light';
|
76
|
+
};
|