retail-design-system 1.0.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/.github/workflows/release.yml +46 -0
- package/.oxfmtrc.json +17 -0
- package/.oxlintrc.json +132 -0
- package/.vscode/extensions.json +3 -0
- package/.vscode/settings.json +13 -0
- package/README.md +56 -0
- package/apps/storybook/.storybook/main.ts +8 -0
- package/apps/storybook/.storybook/preview.css +9 -0
- package/apps/storybook/.storybook/preview.ts +6 -0
- package/apps/storybook/package.json +24 -0
- package/apps/storybook/stories/button.stories.ts +118 -0
- package/apps/storybook/stories/input.stories.ts +127 -0
- package/apps/storybook/stories/label.stories.ts +98 -0
- package/apps/storybook/tsconfig.app.json +24 -0
- package/apps/storybook/tsconfig.json +4 -0
- package/apps/storybook/tsconfig.node.json +22 -0
- package/apps/storybook/vite.config.ts +15 -0
- package/apps/web/app/(sidebar)/components/[...slugs]/get-child-block.ts +17 -0
- package/apps/web/app/(sidebar)/components/[...slugs]/get-component-page-match.ts +56 -0
- package/apps/web/app/(sidebar)/components/[...slugs]/get-direct-child-block.ts +22 -0
- package/apps/web/app/(sidebar)/components/[...slugs]/layout.tsx +25 -0
- package/apps/web/app/(sidebar)/components/[...slugs]/page.tsx +32 -0
- package/apps/web/app/(sidebar)/components/[...slugs]/pascal-to-kebab-case.ts +9 -0
- package/apps/web/app/(sidebar)/components/button2/page.tsx +154 -0
- package/apps/web/app/(sidebar)/components/input/page.tsx +98 -0
- package/apps/web/app/(sidebar)/experiments/2025-10-22/mayhem-mode-card-badge.tsx +9 -0
- package/apps/web/app/(sidebar)/experiments/2025-10-22/mayhem-mode-coin-active-badge.tsx +14 -0
- package/apps/web/app/(sidebar)/experiments/2025-10-22/mayhem-mode-coin-inactive-badge.tsx +12 -0
- package/apps/web/app/(sidebar)/experiments/2025-10-22/mayhem-mode-create-coin.tsx +44 -0
- package/apps/web/app/(sidebar)/experiments/2025-10-22/mayhem-mode-dialog-icon.tsx +47 -0
- package/apps/web/app/(sidebar)/experiments/2025-10-22/page.tsx +167 -0
- package/apps/web/app/(sidebar)/experiments/2025-11-04/filters.tsx +90 -0
- package/apps/web/app/(sidebar)/experiments/2025-11-04/page.tsx +18 -0
- package/apps/web/app/(sidebar)/layout.tsx +17 -0
- package/apps/web/app/(sidebar)/primitives/colors/page.tsx +49 -0
- package/apps/web/app/favicon.ico +0 -0
- package/apps/web/app/layout.tsx +39 -0
- package/apps/web/app/page.tsx +14 -0
- package/apps/web/app/providers.tsx +15 -0
- package/apps/web/components/dialog.tsx +21 -0
- package/apps/web/components/logo.tsx +11 -0
- package/apps/web/components/logomark.tsx +21 -0
- package/apps/web/components/logotype.tsx +25 -0
- package/apps/web/components/notion/notion-block-content.tsx +401 -0
- package/apps/web/components/notion/notion-docs-blocks.tsx +18 -0
- package/apps/web/components/notion/notion-docs-code-page.tsx +20 -0
- package/apps/web/components/notion/notion-docs-layout.tsx +52 -0
- package/apps/web/components/notion/notion-revalidate-button-client.tsx +14 -0
- package/apps/web/components/notion/notion-revalidate-button.tsx +20 -0
- package/apps/web/components/notion/notion-rich-text-segments.tsx +55 -0
- package/apps/web/components/notion/notion-tabs.tsx +38 -0
- package/apps/web/components/notion/notion.ts +223 -0
- package/apps/web/components/sidebar-client.tsx +60 -0
- package/apps/web/components/sidebar-server.tsx +185 -0
- package/apps/web/components/tooltip.tsx +53 -0
- package/apps/web/components/topbar.tsx +14 -0
- package/apps/web/next.config.ts +10 -0
- package/apps/web/package.json +42 -0
- package/apps/web/postcss.config.mjs +5 -0
- package/apps/web/public/2025-10-22-dialog-banner.png +0 -0
- package/apps/web/public/pump-logomark.svg +7 -0
- package/apps/web/styles/custom.css +31 -0
- package/apps/web/styles/font.css +8 -0
- package/apps/web/styles/global.css +5 -0
- package/apps/web/styles/tailwind-reset.css +102 -0
- package/apps/web/styles/tailwind.css +140 -0
- package/apps/web/tsconfig.json +34 -0
- package/bun.lock +1249 -0
- package/bunfig.toml +2 -0
- package/package.json +41 -0
- package/packages/ui/global.d.ts +4 -0
- package/packages/ui/package.json +49 -0
- package/packages/ui/src/components/button/button-spinner.module.css +95 -0
- package/packages/ui/src/components/button/button-spinner.tsx +18 -0
- package/packages/ui/src/components/button/button.module.css +144 -0
- package/packages/ui/src/components/button/button.tsx +102 -0
- package/packages/ui/src/components/button-link/button-link.tsx +46 -0
- package/packages/ui/src/components/column/column.module.css +4 -0
- package/packages/ui/src/components/column/column.tsx +65 -0
- package/packages/ui/src/components/row/row.module.css +4 -0
- package/packages/ui/src/components/row/row.tsx +65 -0
- package/packages/ui/src/components/spacer/spacer.module.css +3 -0
- package/packages/ui/src/components/spacer/spacer.tsx +30 -0
- package/packages/ui/src/components/switch/switch.module.css +62 -0
- package/packages/ui/src/components/switch/switch.tsx +58 -0
- package/packages/ui/src/components/tabs/tabs-panel.module.css +4 -0
- package/packages/ui/src/components/tabs/tabs-panel.tsx +21 -0
- package/packages/ui/src/components/tabs/tabs.module.css +5 -0
- package/packages/ui/src/components/tabs/tabs.tsx +21 -0
- package/packages/ui/src/components/tabs-underline/tabs-underline-indicator.module.css +10 -0
- package/packages/ui/src/components/tabs-underline/tabs-underline-indicator.tsx +33 -0
- package/packages/ui/src/components/tabs-underline/tabs-underline-list.module.css +8 -0
- package/packages/ui/src/components/tabs-underline/tabs-underline-list.tsx +27 -0
- package/packages/ui/src/components/tabs-underline/tabs-underline-tab.module.css +24 -0
- package/packages/ui/src/components/tabs-underline/tabs-underline-tab.tsx +30 -0
- package/packages/ui/src/foundations/colors/colors.ts +475 -0
- package/packages/ui/src/foundations/colors/generate-css.ts +34 -0
- package/packages/ui/src/foundations/colors/retail-design-system.css +116 -0
- package/packages/ui/src/foundations/colors/tailwind-v3.ts +18 -0
- package/packages/ui/src/foundations/colors/tailwind-v4.css +116 -0
- package/packages/ui/src/index.ts +34 -0
- package/packages/ui/src/input.module.css +57 -0
- package/packages/ui/src/input.tsx +49 -0
- package/packages/ui/src/label.module.css +8 -0
- package/packages/ui/src/label.tsx +23 -0
- package/packages/ui/tsconfig.json +14 -0
- package/packages/ui/tsup.config.ts +31 -0
- package/scripts/clean.sh +69 -0
- package/scripts/sort-package-json.sh +30 -0
- package/turbo.json +15 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* ===================================================== */
|
|
2
|
+
/* Base */
|
|
3
|
+
/* ===================================================== */
|
|
4
|
+
.switch {
|
|
5
|
+
display: flex;
|
|
6
|
+
padding: 2px;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
outline-width: 2px;
|
|
10
|
+
outline-style: none;
|
|
11
|
+
outline-color: var(--color-bg-accent);
|
|
12
|
+
outline-offset: 2px;
|
|
13
|
+
background-color: var(--color-bg-tertiary);
|
|
14
|
+
border-radius: 9999px;
|
|
15
|
+
transition-duration: 150ms;
|
|
16
|
+
transition-property: background-color;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.switch:focus-visible {
|
|
20
|
+
outline-style: solid;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.switch[data-checked] {
|
|
24
|
+
background-color: var(--color-bg-accent);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.switch[data-disabled] {
|
|
28
|
+
cursor: not-allowed;
|
|
29
|
+
opacity: 0.5;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* ===================================================== */
|
|
33
|
+
/* Thumb */
|
|
34
|
+
/* ===================================================== */
|
|
35
|
+
|
|
36
|
+
.switch__thumb {
|
|
37
|
+
height: 100%;
|
|
38
|
+
aspect-ratio: 1 / 1;
|
|
39
|
+
background-color: white;
|
|
40
|
+
border-radius: 9999px;
|
|
41
|
+
transition-duration: 150ms;
|
|
42
|
+
transition-property: transform;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.switch__thumb[data-checked] {
|
|
46
|
+
transform: translateX(var(--translateX));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* ===================================================== */
|
|
50
|
+
/* Size */
|
|
51
|
+
/* ===================================================== */
|
|
52
|
+
.switch__size_14 {
|
|
53
|
+
--translateX: 12px;
|
|
54
|
+
width: 30px;
|
|
55
|
+
height: 18px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.switch__size_24 {
|
|
59
|
+
--translateX: 16px;
|
|
60
|
+
width: 40px;
|
|
61
|
+
height: 24px;
|
|
62
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Switch as BaseSwitch } from "@base-ui/react"
|
|
2
|
+
import type { ComponentProps, JSX } from "react"
|
|
3
|
+
import styles from "@/components/switch/switch.module.css"
|
|
4
|
+
|
|
5
|
+
export interface SwitchProps extends Omit<
|
|
6
|
+
ComponentProps<typeof BaseSwitch.Root>,
|
|
7
|
+
"checked" | "defaultChecked" | "disabled" | "nativeButton" | "readOnly" | "required"
|
|
8
|
+
> {
|
|
9
|
+
isChecked?: boolean
|
|
10
|
+
isDefaultChecked?: boolean
|
|
11
|
+
isDisabled?: boolean
|
|
12
|
+
isReadOnly?: boolean
|
|
13
|
+
isRequired?: boolean
|
|
14
|
+
size?: 14 | 24
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function Switch(props: SwitchProps): JSX.Element {
|
|
18
|
+
const {
|
|
19
|
+
className: customClassName = "",
|
|
20
|
+
isChecked = undefined,
|
|
21
|
+
isDefaultChecked = false,
|
|
22
|
+
isDisabled = false,
|
|
23
|
+
isReadOnly = false,
|
|
24
|
+
isRequired = false,
|
|
25
|
+
size = 24,
|
|
26
|
+
...rest
|
|
27
|
+
} = props
|
|
28
|
+
|
|
29
|
+
const combinedClassName = `
|
|
30
|
+
${SWITCH_CLASS_NAME.BASE}
|
|
31
|
+
${SWITCH_CLASS_NAME.SIZE[size]}
|
|
32
|
+
${customClassName}
|
|
33
|
+
`
|
|
34
|
+
.replaceAll(/\s+/g, " ")
|
|
35
|
+
.trim()
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<BaseSwitch.Root
|
|
39
|
+
checked={isChecked}
|
|
40
|
+
className={combinedClassName}
|
|
41
|
+
defaultChecked={isDefaultChecked}
|
|
42
|
+
disabled={isDisabled}
|
|
43
|
+
readOnly={isReadOnly}
|
|
44
|
+
required={isRequired}
|
|
45
|
+
{...rest}
|
|
46
|
+
>
|
|
47
|
+
<BaseSwitch.Thumb className={styles.switch__thumb} />
|
|
48
|
+
</BaseSwitch.Root>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const SWITCH_CLASS_NAME = {
|
|
53
|
+
BASE: styles.switch,
|
|
54
|
+
SIZE: {
|
|
55
|
+
14: styles.switch__size_14,
|
|
56
|
+
24: styles.switch__size_24,
|
|
57
|
+
},
|
|
58
|
+
} as const
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Tabs as BaseTabs } from "@base-ui/react"
|
|
2
|
+
import styles from "@/components/tabs/tabs-panel.module.css"
|
|
3
|
+
|
|
4
|
+
export interface TabsPanelProps extends BaseTabs.Panel.Props {}
|
|
5
|
+
|
|
6
|
+
export function TabsPanel(props: TabsPanelProps) {
|
|
7
|
+
const { className: customClassName = "", ...rest } = props
|
|
8
|
+
|
|
9
|
+
const combinedClassName = `
|
|
10
|
+
${TABS_PANEL_CLASS_NAME.BASE}
|
|
11
|
+
${customClassName}
|
|
12
|
+
`
|
|
13
|
+
.replaceAll(/\s+/g, " ")
|
|
14
|
+
.trim()
|
|
15
|
+
|
|
16
|
+
return <BaseTabs.Panel className={combinedClassName} data-slot="tabs-panel" {...rest} />
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const TABS_PANEL_CLASS_NAME = {
|
|
20
|
+
BASE: styles.tabs_panel,
|
|
21
|
+
} as const
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Tabs as BaseTabs } from "@base-ui/react"
|
|
2
|
+
import styles from "@/components/tabs/tabs.module.css"
|
|
3
|
+
|
|
4
|
+
export interface TabsProps extends BaseTabs.Root.Props {}
|
|
5
|
+
|
|
6
|
+
export function Tabs(props: TabsProps) {
|
|
7
|
+
const { className: customClassName = "", ...rest } = props
|
|
8
|
+
|
|
9
|
+
const combinedClassName = `
|
|
10
|
+
${TABS_CLASS_NAME.BASE}
|
|
11
|
+
${customClassName}
|
|
12
|
+
`
|
|
13
|
+
.replaceAll(/\s+/g, " ")
|
|
14
|
+
.trim()
|
|
15
|
+
|
|
16
|
+
return <BaseTabs.Root className={combinedClassName} data-slot="tabs" {...rest} />
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const TABS_CLASS_NAME = {
|
|
20
|
+
BASE: styles.tabs,
|
|
21
|
+
} as const
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Tabs as BaseTabs } from "@base-ui/react"
|
|
2
|
+
import styles from "@/components/tabs-underline/tabs-underline-indicator.module.css"
|
|
3
|
+
|
|
4
|
+
export interface TabsUnderlineIndicatorProps extends Omit<
|
|
5
|
+
BaseTabs.Indicator.Props,
|
|
6
|
+
"renderBeforeHydration"
|
|
7
|
+
> {
|
|
8
|
+
isRenderBeforeHydration?: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function TabsUnderlineIndicator(props: TabsUnderlineIndicatorProps) {
|
|
12
|
+
const { className: customClassName = "", isRenderBeforeHydration = true, ...rest } = props
|
|
13
|
+
|
|
14
|
+
const combinedClassName = `
|
|
15
|
+
${TABS_UNDERLINE_INDICATOR_CLASS_NAME.BASE}
|
|
16
|
+
${customClassName}
|
|
17
|
+
`
|
|
18
|
+
.replaceAll(/\s+/g, " ")
|
|
19
|
+
.trim()
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<BaseTabs.Indicator
|
|
23
|
+
className={combinedClassName}
|
|
24
|
+
data-slot="tabs-indicator"
|
|
25
|
+
renderBeforeHydration={isRenderBeforeHydration}
|
|
26
|
+
{...rest}
|
|
27
|
+
/>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const TABS_UNDERLINE_INDICATOR_CLASS_NAME = {
|
|
32
|
+
BASE: styles.tabs_underline_indicator,
|
|
33
|
+
} as const
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Tabs as BaseTabs } from "@base-ui/react"
|
|
2
|
+
import { TabsUnderlineIndicator } from "@/components/tabs-underline/tabs-underline-indicator"
|
|
3
|
+
import styles from "@/components/tabs-underline/tabs-underline-list.module.css"
|
|
4
|
+
|
|
5
|
+
export interface TabsUnderlineListProps extends BaseTabs.List.Props {}
|
|
6
|
+
|
|
7
|
+
export function TabsUnderlineList(props: TabsUnderlineListProps) {
|
|
8
|
+
const { className: customClassName = "", children = "", ...rest } = props
|
|
9
|
+
|
|
10
|
+
const combinedClassName = `
|
|
11
|
+
${TABS_UNDERLINE_LIST_CLASS_NAME.BASE}
|
|
12
|
+
${customClassName}
|
|
13
|
+
`
|
|
14
|
+
.replaceAll(/\s+/g, " ")
|
|
15
|
+
.trim()
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<BaseTabs.List className={combinedClassName} data-slot="tabs-list" {...rest}>
|
|
19
|
+
{children}
|
|
20
|
+
<TabsUnderlineIndicator />
|
|
21
|
+
</BaseTabs.List>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const TABS_UNDERLINE_LIST_CLASS_NAME = {
|
|
26
|
+
BASE: styles.tabs_underline_list,
|
|
27
|
+
} as const
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.tabs_underline_tab {
|
|
2
|
+
border-radius: 8px;
|
|
3
|
+
color: var(--color-text-secondary);
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
font-size: 14px;
|
|
6
|
+
font-weight: 500;
|
|
7
|
+
margin-bottom: 6px;
|
|
8
|
+
outline-color: var(--color-bg-accent);
|
|
9
|
+
outline-offset: -2px;
|
|
10
|
+
outline-style: none;
|
|
11
|
+
outline-width: 2px;
|
|
12
|
+
padding: 6px 12px;
|
|
13
|
+
transition-duration: 150ms;
|
|
14
|
+
transition-property: color;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.tabs_underline_tab:focus-visible {
|
|
18
|
+
outline-style: solid;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.tabs_underline_tab:hover,
|
|
22
|
+
.tabs_underline_tab[data-active] {
|
|
23
|
+
color: var(--color-text-primary);
|
|
24
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Tabs as BaseTabs } from "@base-ui/react"
|
|
2
|
+
import styles from "@/components/tabs-underline/tabs-underline-tab.module.css"
|
|
3
|
+
|
|
4
|
+
export interface TabsUnderlineTabProps extends Omit<BaseTabs.Tab.Props, "nativeButton"> {
|
|
5
|
+
isNativeButton?: boolean
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function TabsUnderlineTab(props: TabsUnderlineTabProps) {
|
|
9
|
+
const { className: customClassName = "", isNativeButton = true, ...rest } = props
|
|
10
|
+
|
|
11
|
+
const combinedClassName = `
|
|
12
|
+
${TABS_UNDERLINE_TAB_CLASS_NAME.BASE}
|
|
13
|
+
${customClassName}
|
|
14
|
+
`
|
|
15
|
+
.replaceAll(/\s+/g, " ")
|
|
16
|
+
.trim()
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<BaseTabs.Tab
|
|
20
|
+
className={combinedClassName}
|
|
21
|
+
data-slot="tabs-tab"
|
|
22
|
+
nativeButton={isNativeButton}
|
|
23
|
+
{...rest}
|
|
24
|
+
/>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const TABS_UNDERLINE_TAB_CLASS_NAME = {
|
|
29
|
+
BASE: styles.tabs_underline_tab,
|
|
30
|
+
} as const
|