@balikjs/mobile 0.0.2 → 0.1.1

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.
Files changed (107) hide show
  1. package/dist/index.js +3537 -0
  2. package/dist/styles.css +1 -1
  3. package/package.json +209 -10
  4. package/dist/mobile.js +0 -3235
  5. package/src/Alert/Alert.jsx +0 -67
  6. package/src/Alert/Alert.module.css +0 -87
  7. package/src/Alert/index.js +0 -1
  8. package/src/Avatar/Avatar.jsx +0 -77
  9. package/src/Avatar/Avatar.module.css +0 -74
  10. package/src/Avatar/index.js +0 -1
  11. package/src/Badge/Badge.jsx +0 -83
  12. package/src/Badge/Badge.module.css +0 -141
  13. package/src/Badge/index.js +0 -1
  14. package/src/BottomNavigation/BottomNavigation.jsx +0 -61
  15. package/src/BottomNavigation/BottomNavigation.module.css +0 -53
  16. package/src/BottomNavigation/index.js +0 -1
  17. package/src/BottomSheet/BottomSheet.jsx +0 -51
  18. package/src/BottomSheet/BottomSheet.module.css +0 -56
  19. package/src/BottomSheet/index.js +0 -1
  20. package/src/Button/Button.jsx +0 -77
  21. package/src/Button/Button.module.css +0 -124
  22. package/src/Button/index.js +0 -1
  23. package/src/Card/Card.jsx +0 -31
  24. package/src/Card/Card.module.css +0 -4
  25. package/src/Card/index.js +0 -1
  26. package/src/Checkbox/Checkbox.jsx +0 -64
  27. package/src/Checkbox/Checkbox.module.css +0 -146
  28. package/src/Checkbox/index.js +0 -1
  29. package/src/Clipboard/Clipboard.jsx +0 -82
  30. package/src/Clipboard/Clipboard.module.css +0 -126
  31. package/src/Clipboard/index.js +0 -1
  32. package/src/CloseButton/CloseButton.jsx +0 -51
  33. package/src/CloseButton/CloseButton.module.css +0 -94
  34. package/src/Confirm/Confirm.jsx +0 -52
  35. package/src/Confirm/Confirm.module.css +0 -5
  36. package/src/Confirm/index.js +0 -1
  37. package/src/DatePicker/DatePicker.jsx +0 -276
  38. package/src/DatePicker/DatePicker.module.css +0 -197
  39. package/src/DatePicker/index.js +0 -1
  40. package/src/Dialog/Dialog.jsx +0 -63
  41. package/src/Dialog/Dialog.module.css +0 -111
  42. package/src/Dialog/index.js +0 -1
  43. package/src/Divider/Divider.jsx +0 -38
  44. package/src/Divider/Divider.module.css +0 -16
  45. package/src/Divider/index.js +0 -1
  46. package/src/Drawer/Drawer.jsx +0 -55
  47. package/src/Drawer/Drawer.module.css +0 -68
  48. package/src/Drawer/index.js +0 -1
  49. package/src/Empty/Empty.jsx +0 -35
  50. package/src/Empty/Empty.module.css +0 -17
  51. package/src/Empty/index.js +0 -1
  52. package/src/Fab/Fab.jsx +0 -91
  53. package/src/Fab/Fab.module.css +0 -94
  54. package/src/Fab/index.js +0 -1
  55. package/src/Input/Input.jsx +0 -53
  56. package/src/Input/Input.module.css +0 -97
  57. package/src/Input/index.js +0 -1
  58. package/src/Link/Link.jsx +0 -31
  59. package/src/Link/Link.module.css +0 -18
  60. package/src/Link/index.js +0 -1
  61. package/src/Popover/Popover.jsx +0 -162
  62. package/src/Popover/Popover.module.css +0 -63
  63. package/src/Popover/index.js +0 -1
  64. package/src/RadioGroup/Radio.jsx +0 -52
  65. package/src/RadioGroup/Radio.module.css +0 -133
  66. package/src/RadioGroup/RadioGroup.jsx +0 -36
  67. package/src/RadioGroup/RadioGroup.module.css +0 -23
  68. package/src/RadioGroup/index.js +0 -2
  69. package/src/SearchInput/SearchInput.jsx +0 -89
  70. package/src/SearchInput/SearchInput.module.css +0 -169
  71. package/src/SearchInput/index.js +0 -1
  72. package/src/Select/Select.jsx +0 -102
  73. package/src/Select/Select.module.css +0 -174
  74. package/src/Select/index.js +0 -1
  75. package/src/SelectPc/Select.jsx +0 -88
  76. package/src/SelectPc/SelectPc.module.css +0 -132
  77. package/src/SelectPc/index.js +0 -1
  78. package/src/Skeleton/Skeleton.jsx +0 -55
  79. package/src/Skeleton/Skeleton.module.css +0 -33
  80. package/src/Skeleton/index.js +0 -1
  81. package/src/Slider/Slider.jsx +0 -50
  82. package/src/Slider/Slider.module.css +0 -77
  83. package/src/Slider/index.js +0 -1
  84. package/src/Spinner/Spinner.jsx +0 -45
  85. package/src/Spinner/Spinner.module.css +0 -35
  86. package/src/Spinner/index.js +0 -1
  87. package/src/Switch/Switch.jsx +0 -51
  88. package/src/Switch/Switch.module.css +0 -156
  89. package/src/Switch/index.js +0 -1
  90. package/src/Tabs/Tabs.jsx +0 -75
  91. package/src/Tabs/Tabs.module.css +0 -45
  92. package/src/Tabs/index.js +0 -1
  93. package/src/Tag/Tag.jsx +0 -74
  94. package/src/Tag/Tag.module.css +0 -128
  95. package/src/Tag/index.js +0 -1
  96. package/src/Textarea/Textarea.jsx +0 -52
  97. package/src/Textarea/Textarea.module.css +0 -89
  98. package/src/Textarea/index.js +0 -1
  99. package/src/Toast/Toast.jsx +0 -169
  100. package/src/Toast/Toast.module.css +0 -152
  101. package/src/Toast/index.js +0 -1
  102. package/src/Tooltip/Tooltip.jsx +0 -42
  103. package/src/Tooltip/Tooltip.module.css +0 -41
  104. package/src/Tooltip/index.js +0 -1
  105. package/src/index.js +0 -35
  106. package/src/styles/index.css +0 -90
  107. package/src/styles/tokens.css +0 -227
@@ -1,67 +0,0 @@
1
- import { splitProps, mergeProps, Show } from 'solid-js'
2
- import { CircleCheck, TriangleAlert, CircleAlert, Info } from 'lucide-solid'
3
- import { CloseButton } from '../CloseButton/CloseButton.jsx'
4
- import styles from './Alert.module.css'
5
-
6
- const intents = {
7
- info: styles.intentInfo,
8
- success: styles.intentSuccess,
9
- warning: styles.intentWarning,
10
- danger: styles.intentDanger,
11
- }
12
-
13
- const intentIcons = {
14
- success: () => <CircleCheck size={20} aria-hidden="true" />,
15
- warning: () => <TriangleAlert size={20} aria-hidden="true" />,
16
- danger: () => <CircleAlert size={20} aria-hidden="true" />,
17
- info: () => <Info size={20} aria-hidden="true" />,
18
- }
19
-
20
- const DEFAULT_PROPS = {
21
- intent: 'info',
22
- closeable: false,
23
- }
24
-
25
- /**
26
- * @param {{
27
- * title: string
28
- * description?: string
29
- * intent?: 'info' | 'success' | 'warning' | 'danger'
30
- * closeable?: boolean
31
- * onClose?: () => void
32
- * class?: string
33
- * }} props
34
- */
35
- export function Alert(props) {
36
- const [local, rest] = splitProps(
37
- mergeProps(DEFAULT_PROPS, props),
38
- ['title', 'description', 'intent', 'closeable', 'onClose', 'class'],
39
- )
40
-
41
- return (
42
- <div
43
- {...rest}
44
- role="alert"
45
- class={[
46
- 'balik-alert',
47
- `balik-alert--${local.intent}`,
48
- styles.base,
49
- intents[local.intent],
50
- local.class,
51
- ]
52
- .filter(Boolean)
53
- .join(' ')}
54
- >
55
- <span class={styles.icon}>{intentIcons[local.intent]()}</span>
56
- <div class={styles.body}>
57
- <p class={styles.title}>{local.title}</p>
58
- <Show when={local.description}>
59
- <p class={styles.description}>{local.description}</p>
60
- </Show>
61
- </div>
62
- <Show when={local.closeable}>
63
- <CloseButton size="xs" class={styles.close} onClick={() => local.onClose?.()} />
64
- </Show>
65
- </div>
66
- )
67
- }
@@ -1,87 +0,0 @@
1
- .base {
2
- --_alert-tint: transparent;
3
- --_alert-accent: transparent;
4
-
5
- display: flex;
6
- align-items: flex-start;
7
- gap: var(--b-spacing-sm);
8
- padding: var(--b-container-padding-sm) var(--b-container-padding-sm);
9
- border-radius: var(--b-radius-l2-sm);
10
- background-color: var(--_alert-tint);
11
- border-left: 3px solid var(--_alert-accent);
12
- }
13
-
14
- .icon {
15
- flex-shrink: 0;
16
- width: 20px;
17
- height: 20px;
18
- margin-top: 1px;
19
- color: var(--_alert-accent);
20
- }
21
-
22
- .icon svg {
23
- display: block;
24
- width: 100%;
25
- height: 100%;
26
- }
27
-
28
- .body {
29
- flex: 1;
30
- min-width: 0;
31
- }
32
-
33
- .title {
34
- margin: 0;
35
- font-size: var(--b-comp-font-size-md);
36
- line-height: var(--b-comp-line-height-md);
37
- color: var(--base-fg);
38
- }
39
-
40
- .description {
41
- margin: var(--b-spacing-xxs) 0 0;
42
- font-size: var(--b-comp-font-size-sm);
43
- line-height: var(--b-comp-line-height-sm);
44
- color: color-mix(in oklch, var(--base-fg) 60%, transparent);
45
- }
46
-
47
- .close {
48
- flex-shrink: 0;
49
- display: flex;
50
- align-items: center;
51
- justify-content: center;
52
- width: 24px;
53
- height: 24px;
54
- margin: -1px -4px 0 0;
55
- padding: 0;
56
- border: none;
57
- border-radius: var(--b-radius-l1-sm);
58
- background: transparent;
59
- color: color-mix(in oklch, var(--base-fg) 35%, transparent);
60
- cursor: pointer;
61
- }
62
-
63
- .close svg {
64
- display: block;
65
- width: 14px;
66
- height: 14px;
67
- }
68
-
69
- .intentInfo {
70
- --_alert-tint: color-mix(in oklch, var(--color-info) 10%, var(--base-bg));
71
- --_alert-accent: var(--color-info);
72
- }
73
-
74
- .intentSuccess {
75
- --_alert-tint: color-mix(in oklch, var(--color-success) 10%, var(--base-bg));
76
- --_alert-accent: var(--color-success);
77
- }
78
-
79
- .intentWarning {
80
- --_alert-tint: color-mix(in oklch, var(--color-warning) 10%, var(--base-bg));
81
- --_alert-accent: var(--color-warning);
82
- }
83
-
84
- .intentDanger {
85
- --_alert-tint: color-mix(in oklch, var(--color-danger) 10%, var(--base-bg));
86
- --_alert-accent: var(--color-danger);
87
- }
@@ -1 +0,0 @@
1
- export { Alert } from './Alert.jsx'
@@ -1,77 +0,0 @@
1
- import { splitProps, mergeProps, Show, createMemo } from 'solid-js'
2
- import styles from './Avatar.module.css'
3
-
4
- const sizes = {
5
- xs: styles.sizeXs,
6
- sm: styles.sizeSm,
7
- md: styles.sizeMd,
8
- lg: styles.sizeLg,
9
- xl: styles.sizeXl,
10
- '2xl': styles.size2xl,
11
- }
12
-
13
- const genders = {
14
- male: styles.male,
15
- female: styles.female,
16
- }
17
-
18
- const DEFAULT_PROPS = {
19
- size: 'md',
20
- gender: 'male',
21
- }
22
-
23
- /**
24
- * @param {import('solid-js').JSX.HTMLAttributes<HTMLSpanElement> & {
25
- * src?: string
26
- * alt?: string
27
- * name?: string
28
- * size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'
29
- * gender?: 'male' | 'female'
30
- * class?: string
31
- * }} props
32
- */
33
- export function Avatar(props) {
34
- const [local, rest] = splitProps(
35
- mergeProps(DEFAULT_PROPS, props),
36
- ['src', 'alt', 'name', 'size', 'gender', 'class'],
37
- )
38
-
39
- const initials = createMemo(() => {
40
- if (!local.name) return '?'
41
- return local.name
42
- .split(/\s+/)
43
- .filter(Boolean)
44
- .slice(0, 2)
45
- .map((w) => w[0])
46
- .join('')
47
- })
48
-
49
- return (
50
- <span
51
- {...rest}
52
- role="img"
53
- aria-label={local.alt || local.name || 'Avatar'}
54
- class={[
55
- 'balik-avatar',
56
- `balik-avatar--${local.size}`,
57
- styles.base,
58
- sizes[local.size],
59
- genders[local.gender],
60
- local.class,
61
- ]
62
- .filter(Boolean)
63
- .join(' ')}
64
- >
65
- <Show
66
- when={local.src}
67
- fallback={
68
- <span class={styles.fallback} aria-hidden="true">
69
- {initials()}
70
- </span>
71
- }
72
- >
73
- <img class={styles.image} src={local.src} alt={local.alt || ''} />
74
- </Show>
75
- </span>
76
- )
77
- }
@@ -1,74 +0,0 @@
1
- .base {
2
- position: relative;
3
- display: inline-flex;
4
- align-items: center;
5
- justify-content: center;
6
- flex-shrink: 0;
7
- border-radius: 50%;
8
- background-color: color-mix(in oklch, var(--base-edge) 15%, var(--base-bg));
9
- color: var(--base-edge);
10
- font-family: inherit;
11
- font-weight: 600;
12
- text-transform: uppercase;
13
- overflow: hidden;
14
- user-select: none;
15
- }
16
-
17
- .image {
18
- position: absolute;
19
- inset: 0;
20
- width: 100%;
21
- height: 100%;
22
- object-fit: cover;
23
- border-radius: 50%;
24
- }
25
-
26
- .fallback {
27
- line-height: 1;
28
- }
29
-
30
- .sizeXs {
31
- width: var(--b-comp-height-xs);
32
- height: var(--b-comp-height-xs);
33
- font-size: 14px;
34
- }
35
-
36
- .sizeSm {
37
- width: var(--b-comp-height-sm);
38
- height: var(--b-comp-height-sm);
39
- font-size: 16px;
40
- }
41
-
42
- .sizeMd {
43
- width: var(--b-comp-height-md);
44
- height: var(--b-comp-height-md);
45
- font-size: 18px;
46
- }
47
-
48
- .sizeLg {
49
- width: var(--b-comp-height-lg);
50
- height: var(--b-comp-height-lg);
51
- font-size: 20px;
52
- }
53
-
54
- .sizeXl {
55
- width: var(--b-comp-height-xl);
56
- height: var(--b-comp-height-xl);
57
- font-size: 22px;
58
- }
59
-
60
- .size2xl {
61
- width: var(--b-comp-height-2xl);
62
- height: var(--b-comp-height-2xl);
63
- font-size: 28px;
64
- }
65
-
66
- .male {
67
- background-color: #e3f2fd;
68
- color: #1976d2;
69
- }
70
-
71
- .female {
72
- background-color: #fce4ec;
73
- color: #c62828;
74
- }
@@ -1 +0,0 @@
1
- export { Avatar } from './Avatar.jsx'
@@ -1,83 +0,0 @@
1
- import { splitProps, mergeProps, Show } from 'solid-js'
2
- import styles from './Badge.module.css'
3
-
4
- const sizes = {
5
- xs: styles.sizeXs,
6
- sm: styles.sizeSm,
7
- md: styles.sizeMd,
8
- lg: styles.sizeLg,
9
- xl: styles.sizeXl,
10
- '2xl': styles.size2xl,
11
- }
12
-
13
- const solidIntents = {
14
- default: styles.solidDefault,
15
- danger: styles.solidDanger,
16
- success: styles.solidSuccess,
17
- warning: styles.solidWarning,
18
- info: styles.solidInfo,
19
- intent: styles.solidIntent,
20
- }
21
-
22
- const outlineIntents = {
23
- default: styles.outlineDefault,
24
- danger: styles.outlineDanger,
25
- success: styles.outlineSuccess,
26
- warning: styles.outlineWarning,
27
- info: styles.outlineInfo,
28
- intent: styles.outlineIntent,
29
- }
30
-
31
- const intentClasses = {
32
- solid: solidIntents,
33
- outline: outlineIntents,
34
- }
35
-
36
- const DEFAULT_PROPS = {
37
- size: 'md',
38
- intent: 'default',
39
- solid: true,
40
- dot: false,
41
- }
42
-
43
- /**
44
- * @param {import('solid-js').JSX.HTMLAttributes<HTMLSpanElement> & {
45
- * size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'
46
- * intent?: 'default' | 'danger' | 'success' | 'warning' | 'info' | 'intent'
47
- * solid?: boolean
48
- * dot?: boolean
49
- * class?: string
50
- * children?: import('solid-js').JSX.Element
51
- * }} props
52
- */
53
- export function Badge(props) {
54
- const [local, rest] = splitProps(
55
- mergeProps(DEFAULT_PROPS, props),
56
- ['size', 'intent', 'solid', 'dot', 'class', 'children'],
57
- )
58
-
59
- const variant = local.solid ? 'solid' : 'outline'
60
-
61
- return (
62
- <span
63
- {...rest}
64
- class={[
65
- 'balik-badge',
66
- `balik-badge--${variant}`,
67
- `balik-badge--${local.intent}`,
68
- `balik-badge--${local.size}`,
69
- styles.base,
70
- sizes[local.size],
71
- intentClasses[variant][local.intent],
72
- local.class,
73
- ]
74
- .filter(Boolean)
75
- .join(' ')}
76
- >
77
- <Show when={local.dot}>
78
- <span class={styles.dot} aria-hidden="true" />
79
- </Show>
80
- {local.children}
81
- </span>
82
- )
83
- }
@@ -1,141 +0,0 @@
1
- .base {
2
- --_badge-bg: transparent;
3
- --_badge-fg: transparent;
4
- --_badge-border: transparent;
5
-
6
- display: inline-flex;
7
- align-items: center;
8
- justify-content: center;
9
- gap: 4px;
10
- border: 1px solid var(--_badge-border);
11
- border-radius: var(--b-radius-round);
12
- background-color: var(--_badge-bg);
13
- color: var(--_badge-fg);
14
- font-family: inherit;
15
- font-weight: 500;
16
- line-height: 1;
17
- white-space: nowrap;
18
- }
19
-
20
- /* ── Size ── */
21
-
22
- .sizeXs {
23
- height: var(--b-comp-secondary-height-xs);
24
- min-width: calc(2 * var(--b-comp-secondary-height-xs));
25
- padding: 0 6px;
26
- font-size: 10px;
27
- }
28
-
29
- .sizeSm {
30
- height: var(--b-comp-secondary-height-sm);
31
- min-width: calc(2 * var(--b-comp-secondary-height-sm));
32
- padding: 0 7px;
33
- font-size: 10px;
34
- }
35
-
36
- .sizeMd {
37
- height: var(--b-comp-secondary-height-md);
38
- min-width: calc(2 * var(--b-comp-secondary-height-md));
39
- padding: 0 8px;
40
- font-size: 11px;
41
- }
42
-
43
- .sizeLg {
44
- height: var(--b-comp-secondary-height-lg);
45
- min-width: calc(2 * var(--b-comp-secondary-height-lg));
46
- padding: 0 9px;
47
- font-size: 12px;
48
- }
49
-
50
- .sizeXl {
51
- height: var(--b-comp-secondary-height-xl);
52
- min-width: calc(2 * var(--b-comp-secondary-height-xl));
53
- padding: 0 10px;
54
- font-size: 13px;
55
- }
56
-
57
- .size2xl {
58
- height: var(--b-comp-secondary-height-2xl);
59
- min-width: calc(2 * var(--b-comp-secondary-height-2xl));
60
- padding: 0 14px;
61
- font-size: 16px;
62
- }
63
-
64
- /* ── Intent: solid ── */
65
-
66
- .solidDefault {
67
- --_badge-bg: color-mix(in oklch, var(--base-fg) 10%, var(--base-bg));
68
- --_badge-fg: var(--base-fg);
69
- --_badge-border: color-mix(in oklch, var(--base-fg) 10%, var(--base-bg));
70
- }
71
-
72
- .solidDanger {
73
- --_badge-bg: color-mix(in oklch, var(--color-danger) 12%, var(--base-bg));
74
- --_badge-fg: var(--color-danger);
75
- --_badge-border: color-mix(in oklch, var(--color-danger) 12%, var(--base-bg));
76
- }
77
-
78
- .solidSuccess {
79
- --_badge-bg: color-mix(in oklch, var(--color-success) 12%, var(--base-bg));
80
- --_badge-fg: var(--color-success);
81
- --_badge-border: color-mix(in oklch, var(--color-success) 12%, var(--base-bg));
82
- }
83
-
84
- .solidWarning {
85
- --_badge-bg: color-mix(in oklch, var(--color-warning) 12%, var(--base-bg));
86
- --_badge-fg: var(--color-warning);
87
- --_badge-border: color-mix(in oklch, var(--color-warning) 12%, var(--base-bg));
88
- }
89
-
90
- .solidInfo {
91
- --_badge-bg: color-mix(in oklch, var(--color-info) 12%, var(--base-bg));
92
- --_badge-fg: var(--color-info);
93
- --_badge-border: color-mix(in oklch, var(--color-info) 12%, var(--base-bg));
94
- }
95
-
96
- .solidIntent {
97
- --_badge-bg: color-mix(in oklch, var(--base-edge) 12%, var(--base-bg));
98
- --_badge-fg: var(--base-edge);
99
- --_badge-border: color-mix(in oklch, var(--base-edge) 12%, var(--base-bg));
100
- }
101
-
102
- /* ── Intent: outline ── */
103
-
104
- .outlineDefault {
105
- --_badge-fg: color-mix(in oklch, var(--base-fg) 60%, transparent);
106
- --_badge-border: color-mix(in oklch, var(--base-fg) 16%, var(--base-bg));
107
- }
108
-
109
- .outlineDanger {
110
- --_badge-fg: var(--color-danger);
111
- --_badge-border: color-mix(in oklch, var(--color-danger) 25%, var(--base-bg));
112
- }
113
-
114
- .outlineSuccess {
115
- --_badge-fg: var(--color-success);
116
- --_badge-border: color-mix(in oklch, var(--color-success) 25%, var(--base-bg));
117
- }
118
-
119
- .outlineWarning {
120
- --_badge-fg: var(--color-warning);
121
- --_badge-border: color-mix(in oklch, var(--color-warning) 25%, var(--base-bg));
122
- }
123
-
124
- .outlineInfo {
125
- --_badge-fg: var(--color-info);
126
- --_badge-border: color-mix(in oklch, var(--color-info) 25%, var(--base-bg));
127
- }
128
-
129
- .outlineIntent {
130
- --_badge-fg: var(--base-edge);
131
- --_badge-border: color-mix(in oklch, var(--base-edge) 25%, var(--base-bg));
132
- }
133
-
134
- /* ── Dot ── */
135
-
136
- .dot {
137
- width: 6px;
138
- height: 6px;
139
- border-radius: 50%;
140
- background-color: currentColor;
141
- }
@@ -1 +0,0 @@
1
- export { Badge } from './Badge.jsx'
@@ -1,61 +0,0 @@
1
- import { splitProps, mergeProps } from 'solid-js'
2
- import { Dynamic } from 'solid-js/web'
3
- import styles from './BottomNavigation.module.css'
4
-
5
- /**
6
- * @param {{
7
- * icon: import('solid-js').JSX.Element
8
- * label: string
9
- * active?: boolean
10
- * href?: string
11
- * onClick?: (e: MouseEvent) => void
12
- * }} props
13
- */
14
- export function BottomNavigationItem(props) {
15
- const [local] = splitProps(props, ['icon', 'label', 'active', 'href', 'onClick'])
16
-
17
- const tag = local.href ? 'a' : 'button'
18
-
19
- return (
20
- <Dynamic
21
- component={tag}
22
- {...(local.href ? { href: local.href } : { type: 'button' })}
23
- class={styles.item}
24
- data-active={local.active ? '' : undefined}
25
- onClick={local.onClick}
26
- >
27
- <span class={styles.icon}>{local.icon}</span>
28
- <span class={styles.label}>{local.label}</span>
29
- </Dynamic>
30
- )
31
- }
32
-
33
- const DEFAULT_PROPS = {}
34
-
35
- /**
36
- * @param {import('solid-js').JSX.HTMLAttributes<HTMLElement> & {
37
- * class?: string
38
- * }} props
39
- */
40
- export function BottomNavigation(props) {
41
- const [local] = splitProps(
42
- mergeProps(DEFAULT_PROPS, props),
43
- ['class', 'children'],
44
- )
45
-
46
- return (
47
- <nav
48
- class={[
49
- 'balik-bottom-navigation',
50
- styles.root,
51
- local.class,
52
- ]
53
- .filter(Boolean)
54
- .join(' ')}
55
- >
56
- {local.children}
57
- </nav>
58
- )
59
- }
60
-
61
- BottomNavigation.Item = BottomNavigationItem
@@ -1,53 +0,0 @@
1
- .root {
2
- position: fixed;
3
- inset-inline: 0;
4
- bottom: 0;
5
- display: flex;
6
- justify-content: space-around;
7
- align-items: center;
8
- height: 56px;
9
- padding-bottom: env(safe-area-inset-bottom);
10
- background-color: var(--base-bg);
11
- border-top: 1px solid color-mix(in oklch, var(--base-fg) 8%, var(--base-bg));
12
- z-index: var(--b-z-index-base);
13
- }
14
-
15
- .item {
16
- display: flex;
17
- flex-direction: column;
18
- align-items: center;
19
- gap: 2px;
20
- padding: 4px 12px;
21
- border: none;
22
- background: none;
23
- font-family: inherit;
24
- color: color-mix(in oklch, var(--base-fg) 45%, var(--base-bg));
25
- text-decoration: none;
26
- cursor: pointer;
27
- user-select: none;
28
- touch-action: manipulation;
29
- transition: color var(--b-transition-fast);
30
- }
31
-
32
- .item[data-active] {
33
- color: var(--base-edge);
34
- }
35
-
36
- .icon {
37
- display: flex;
38
- align-items: center;
39
- justify-content: center;
40
- width: 24px;
41
- height: 24px;
42
- }
43
-
44
- .icon svg {
45
- width: 100%;
46
- height: 100%;
47
- }
48
-
49
- .label {
50
- font-size: 11px;
51
- line-height: 14px;
52
- font-weight: 500;
53
- }
@@ -1 +0,0 @@
1
- export { BottomNavigation } from './BottomNavigation.jsx'
@@ -1,51 +0,0 @@
1
- import { splitProps, mergeProps } from 'solid-js'
2
- import { Portal } from 'solid-js/web'
3
- import styles from './BottomSheet.module.css'
4
-
5
- const DEFAULT_PROPS = {}
6
-
7
- /**
8
- * @param {{
9
- * open: boolean
10
- * onOpenChange?: (open: boolean) => void
11
- * title?: string
12
- * class?: string
13
- * children?: import('solid-js').JSX.Element
14
- * }} props
15
- */
16
- export function BottomSheet(props) {
17
- const [local] = splitProps(
18
- mergeProps(DEFAULT_PROPS, props),
19
- ['open', 'onOpenChange', 'title', 'class', 'children'],
20
- )
21
-
22
- return (
23
- <Portal mount={document.body}>
24
- <div
25
- class={styles.backdrop}
26
- data-open={local.open ? '' : undefined}
27
- onClick={() => local.onOpenChange?.(false)}
28
- />
29
- <div
30
- class={[
31
- 'balik-bottom-sheet',
32
- styles.sheet,
33
- local.class,
34
- ]
35
- .filter(Boolean)
36
- .join(' ')}
37
- data-open={local.open ? '' : undefined}
38
- role="dialog"
39
- aria-modal="true"
40
- aria-label={local.title || 'BottomSheet'}
41
- >
42
- {local.title && (
43
- <div class={styles.header}>
44
- <h2 class={styles.title}>{local.title}</h2>
45
- </div>
46
- )}
47
- <div class={styles.body}>{local.children}</div>
48
- </div>
49
- </Portal>
50
- )
51
- }