@citygross/components_v2 0.1.0 → 0.1.2
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/components/Button/Button.css.ts.vanilla.css +102 -91
- package/dist/components/Button/Button.css.vanilla.js +5 -4
- package/dist/components/Button/Button.d.ts +5 -17
- package/dist/components/Button/Button.js +40 -49
- package/dist/components/Button/Button.types.d.ts +29 -0
- package/dist/components/Button/Button.types.js +16 -0
- package/dist/components/Button/ButtonAsLink/ButtonAsLink.css.ts.vanilla.css +12 -0
- package/dist/components/Button/ButtonAsLink/ButtonAsLink.css.vanilla.js +5 -0
- package/dist/components/Button/ButtonAsLink/ButtonAsLink.d.ts +9 -0
- package/dist/components/Button/ButtonAsLink/ButtonAsLink.js +19 -0
- package/dist/components/Button/DivAsButton/DivAsButton.d.ts +6 -0
- package/dist/components/Button/DivAsButton/DivAsButton.js +31 -0
- package/dist/components/CartSummary/CartSummary.d.ts +8 -8
- package/dist/components/CartSummary/CartSummary.js +1 -1
- package/dist/components/Flex/Flex.css.ts.vanilla.css +42 -0
- package/dist/components/Flex/Flex.css.vanilla.js +6 -0
- package/dist/components/Flex/Flex.d.ts +11 -0
- package/dist/components/Flex/Flex.js +27 -0
- package/dist/components/Header/Header.js +2 -8
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/Modal.js +2 -2
- package/dist/components/Pagination/Pagination.css.ts.vanilla.css +3 -13
- package/dist/components/Pagination/Pagination.css.vanilla.js +2 -5
- package/dist/components/Pagination/Pagination.d.ts +5 -8
- package/dist/components/Pagination/Pagination.js +50 -66
- package/dist/cssUtils/spacings.css.d.ts +7 -7
- package/dist/cssUtils/typography.css.d.ts +2 -2
- package/dist/index.d.ts +11 -7
- package/dist/index.js +10 -6
- package/package.json +11 -11
|
@@ -1,155 +1,166 @@
|
|
|
1
|
-
.
|
|
2
|
-
outline: none;
|
|
1
|
+
.Button_buttonStyle__fe4m9p1 {
|
|
3
2
|
border: none;
|
|
3
|
+
cursor: pointer;
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
gap: 8px;
|
|
8
|
+
font-family: "Poppins", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
9
|
+
font-weight: 500;
|
|
10
|
+
border-radius: 4px;
|
|
11
|
+
width: max-content;
|
|
12
|
+
position: relative;
|
|
13
|
+
transition: background-color 0.3s ease;
|
|
14
|
+
white-space: nowrap;
|
|
4
15
|
}
|
|
5
|
-
.
|
|
6
|
-
color: #
|
|
7
|
-
|
|
8
|
-
cursor: default;
|
|
16
|
+
.Button_buttonStyle__fe4m9p1:disabled {
|
|
17
|
+
color: #8f8f8f;
|
|
18
|
+
cursor: not-allowed;
|
|
9
19
|
}
|
|
10
|
-
.
|
|
20
|
+
.Button_buttonStyle__fe4m9p1:focus-visible:not(:hover) {
|
|
11
21
|
outline: none;
|
|
12
22
|
box-shadow: 0 0 0 2px #fff,0 0 0 4px #000,0 0 0 6px #fff;
|
|
13
23
|
transition: all 0.1s ease-in-out;
|
|
14
24
|
}
|
|
15
|
-
.
|
|
25
|
+
.Button_buttonStyle_size_small__fe4m9p2 {
|
|
26
|
+
font-size: 13px;
|
|
27
|
+
height: 32px;
|
|
28
|
+
padding: 4px 8px;
|
|
29
|
+
}
|
|
30
|
+
.Button_buttonStyle_size_medium__fe4m9p3 {
|
|
31
|
+
font-size: 15px;
|
|
32
|
+
height: 40px;
|
|
33
|
+
padding: 8px 12px;
|
|
34
|
+
}
|
|
35
|
+
.Button_buttonStyle_size_large__fe4m9p4 {
|
|
36
|
+
font-size: 15px;
|
|
37
|
+
height: 56px;
|
|
38
|
+
padding: 12px 16px;
|
|
39
|
+
}
|
|
40
|
+
.Button_buttonStyle_variant_primary__fe4m9p5 {
|
|
16
41
|
background-color: #0069AE;
|
|
17
42
|
color: #FFFFFF;
|
|
18
43
|
}
|
|
19
|
-
.
|
|
44
|
+
.Button_buttonStyle_variant_primary__fe4m9p5:not(:disabled):hover {
|
|
20
45
|
background-color: #005C99;
|
|
21
46
|
}
|
|
22
|
-
.
|
|
47
|
+
.Button_buttonStyle_variant_primary__fe4m9p5:not(:disabled):active {
|
|
23
48
|
background-color: #004D80;
|
|
24
49
|
}
|
|
25
|
-
.
|
|
50
|
+
.Button_buttonStyle_variant_primary__fe4m9p5:disabled {
|
|
51
|
+
background-color: #E8E8E8;
|
|
52
|
+
}
|
|
53
|
+
.Button_buttonStyle_variant_secondary__fe4m9p6 {
|
|
26
54
|
background-color: #FFFFFF;
|
|
27
55
|
color: #333333;
|
|
28
56
|
border: 1px solid #B8B8B8;
|
|
29
57
|
}
|
|
30
|
-
.
|
|
58
|
+
.Button_buttonStyle_variant_secondary__fe4m9p6:not(:disabled):hover {
|
|
31
59
|
background-color: #F7F7F7;
|
|
32
60
|
}
|
|
33
|
-
.
|
|
61
|
+
.Button_buttonStyle_variant_secondary__fe4m9p6:not(:disabled):active {
|
|
34
62
|
background-color: #F1F1F1;
|
|
35
63
|
}
|
|
36
|
-
.
|
|
37
|
-
color: #B8B8B8;
|
|
38
|
-
}
|
|
39
|
-
.Button_buttonVariant_ghost__fe4m9p3 {
|
|
64
|
+
.Button_buttonStyle_variant_secondary__fe4m9p6:disabled {
|
|
40
65
|
background-color: #FFFFFF;
|
|
41
|
-
color: #333333;
|
|
42
|
-
}
|
|
43
|
-
.Button_buttonVariant_ghost__fe4m9p3:hover:not(:disabled) {
|
|
44
|
-
background-color: #F7F7F7;
|
|
45
|
-
}
|
|
46
|
-
.Button_buttonVariant_ghost__fe4m9p3:active:not(:disabled) {
|
|
47
|
-
background-color: #F1F1F1;
|
|
48
|
-
}
|
|
49
|
-
.Button_buttonVariant_ghost__fe4m9p3:disabled {
|
|
50
|
-
color: #B8B8B8;
|
|
51
66
|
}
|
|
52
|
-
.
|
|
67
|
+
.Button_buttonStyle_variant_tertiary__fe4m9p7 {
|
|
53
68
|
background-color: #FFE522;
|
|
54
69
|
color: #333333;
|
|
55
70
|
}
|
|
56
|
-
.
|
|
71
|
+
.Button_buttonStyle_variant_tertiary__fe4m9p7:not(:disabled):hover {
|
|
57
72
|
background-color: #F5D800;
|
|
58
73
|
}
|
|
59
|
-
.
|
|
74
|
+
.Button_buttonStyle_variant_tertiary__fe4m9p7:not(:disabled):active {
|
|
60
75
|
background-color: #DBC100;
|
|
61
76
|
}
|
|
62
|
-
.
|
|
77
|
+
.Button_buttonStyle_variant_tertiary__fe4m9p7:disabled {
|
|
78
|
+
background-color: #E8E8E8;
|
|
79
|
+
}
|
|
80
|
+
.Button_buttonStyle_variant_prio__fe4m9p8 {
|
|
63
81
|
background-color: #A71680;
|
|
64
82
|
color: #FFFFFF;
|
|
65
83
|
}
|
|
66
|
-
.
|
|
84
|
+
.Button_buttonStyle_variant_prio__fe4m9p8:not(:disabled):hover {
|
|
67
85
|
background-color: #90136F;
|
|
68
86
|
}
|
|
69
|
-
.
|
|
87
|
+
.Button_buttonStyle_variant_prio__fe4m9p8:not(:disabled):active {
|
|
70
88
|
background-color: #7A105E;
|
|
71
89
|
}
|
|
72
|
-
.
|
|
73
|
-
background-color: #
|
|
74
|
-
color: #FFFFFF;
|
|
90
|
+
.Button_buttonStyle_variant_prio__fe4m9p8:disabled {
|
|
91
|
+
background-color: #E8E8E8;
|
|
75
92
|
}
|
|
76
|
-
.
|
|
77
|
-
background-color: #
|
|
93
|
+
.Button_buttonStyle_variant_ghost__fe4m9p9 {
|
|
94
|
+
background-color: #FFFFFF;
|
|
95
|
+
color: #333333;
|
|
78
96
|
}
|
|
79
|
-
.
|
|
80
|
-
background-color: #
|
|
97
|
+
.Button_buttonStyle_variant_ghost__fe4m9p9:not(:disabled):hover {
|
|
98
|
+
background-color: #F7F7F7;
|
|
81
99
|
}
|
|
82
|
-
.
|
|
83
|
-
background-color: #
|
|
100
|
+
.Button_buttonStyle_variant_ghost__fe4m9p9:not(:disabled):active {
|
|
101
|
+
background-color: #F1F1F1;
|
|
84
102
|
}
|
|
85
|
-
.
|
|
86
|
-
|
|
103
|
+
.Button_buttonStyle_variant_ghost__fe4m9p9:disabled {
|
|
104
|
+
background-color: #FFFFFF;
|
|
87
105
|
}
|
|
88
|
-
.
|
|
89
|
-
|
|
106
|
+
.Button_buttonStyle_fullWidth_true__fe4m9pa {
|
|
107
|
+
width: 100%;
|
|
90
108
|
}
|
|
91
|
-
.
|
|
92
|
-
|
|
109
|
+
.Button_buttonStyle_circle_true__fe4m9pb {
|
|
110
|
+
border-radius: 100px;
|
|
111
|
+
height: max-content;
|
|
93
112
|
}
|
|
94
|
-
.
|
|
95
|
-
|
|
113
|
+
.Button_buttonStyle_rounded_true__fe4m9pc {
|
|
114
|
+
border-radius: 100px;
|
|
96
115
|
}
|
|
97
|
-
.
|
|
98
|
-
|
|
116
|
+
.Button_buttonStyle_boxShadow_false__fe4m9pe {
|
|
117
|
+
box-shadow: none;
|
|
99
118
|
}
|
|
100
|
-
.
|
|
101
|
-
|
|
102
|
-
width: 32px;
|
|
103
|
-
display: grid;
|
|
104
|
-
place-content: center;
|
|
119
|
+
.Button_buttonStyle_compound_0__fe4m9pf {
|
|
120
|
+
padding: 4px;
|
|
105
121
|
}
|
|
106
|
-
.
|
|
107
|
-
|
|
122
|
+
.Button_buttonStyle_compound_1__fe4m9pg {
|
|
123
|
+
padding: 8px;
|
|
108
124
|
}
|
|
109
|
-
.
|
|
125
|
+
.Button_buttonStyle_compound_2__fe4m9ph {
|
|
126
|
+
padding: 12px;
|
|
127
|
+
}
|
|
128
|
+
.Button_buttonStyle_compound_3__fe4m9pi {
|
|
110
129
|
box-shadow: inset 0px -1px 0px rgba(0, 0, 0, 0.15);
|
|
111
130
|
}
|
|
112
|
-
.
|
|
131
|
+
.Button_buttonStyle_compound_4__fe4m9pj {
|
|
113
132
|
box-shadow: inset 0px -2px 0px rgba(0, 0, 0, 0.15);
|
|
114
133
|
}
|
|
115
|
-
.
|
|
116
|
-
|
|
117
|
-
box-shadow: none;
|
|
118
|
-
}
|
|
119
|
-
.Button_buttonRadius_default__fe4m9ph {
|
|
120
|
-
border-radius: 4px;
|
|
121
|
-
}
|
|
122
|
-
.Button_button__fe4m9pi {
|
|
123
|
-
cursor: pointer;
|
|
124
|
-
position: relative;
|
|
134
|
+
.Button_buttonStyle_compound_5__fe4m9pk {
|
|
135
|
+
box-shadow: inset 0px -2px 0px rgba(0, 0, 0, 0.15);
|
|
125
136
|
}
|
|
126
|
-
.
|
|
127
|
-
|
|
137
|
+
.Button_buttonStyle_compound_6__fe4m9pl {
|
|
138
|
+
border-radius: 100px;
|
|
128
139
|
}
|
|
129
|
-
.
|
|
130
|
-
|
|
140
|
+
.Button_buttonBase__fe4m9p0 svg {
|
|
141
|
+
display: block;
|
|
131
142
|
}
|
|
132
|
-
.
|
|
143
|
+
.Button_childrenContainer__fe4m9pm {
|
|
133
144
|
display: flex;
|
|
134
|
-
justify-content: center;
|
|
135
145
|
align-items: center;
|
|
136
146
|
gap: 8px;
|
|
137
|
-
flex-direction: row;
|
|
138
|
-
white-space: nowrap;
|
|
139
|
-
min-width: max-content;
|
|
140
147
|
}
|
|
141
|
-
.
|
|
142
|
-
flex-direction: row-reverse;
|
|
143
|
-
}
|
|
144
|
-
.Button_buttonContent_loading_true__fe4m9p13 {
|
|
148
|
+
.Button_childrenContainer_loading_true__fe4m9pn {
|
|
145
149
|
opacity: 0;
|
|
146
150
|
}
|
|
147
|
-
.
|
|
151
|
+
.Button_spinnerContainer__fe4m9po {
|
|
152
|
+
position: absolute;
|
|
153
|
+
}
|
|
154
|
+
.Button_badgeContainer__fe4m9pp {
|
|
155
|
+
background: #000000;
|
|
156
|
+
border-radius: 5px;
|
|
157
|
+
color: #FFFFFF;
|
|
158
|
+
font-size: 10px;
|
|
159
|
+
line-height: 15px;
|
|
160
|
+
min-width: 24px;
|
|
161
|
+
padding: 2px 6px;
|
|
148
162
|
position: absolute;
|
|
149
|
-
top:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
bottom: 0;
|
|
153
|
-
display: grid;
|
|
154
|
-
place-content: center;
|
|
163
|
+
top: -4px;
|
|
164
|
+
right: -4px;
|
|
165
|
+
width: fit-content;
|
|
155
166
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import './Button.css.ts.vanilla.css';
|
|
2
2
|
import { createRuntimeFn } from '@vanilla-extract/recipes/createRuntimeFn';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
4
|
+
var badgeContainer = "Button_badgeContainer__fe4m9pp";
|
|
5
|
+
var buttonStyle = createRuntimeFn({ defaultClassName: "Button_buttonStyle__fe4m9p1 Button_buttonBase__fe4m9p0", variantClassNames: { size: { small: "Button_buttonStyle_size_small__fe4m9p2", medium: "Button_buttonStyle_size_medium__fe4m9p3", large: "Button_buttonStyle_size_large__fe4m9p4" }, variant: { primary: "Button_buttonStyle_variant_primary__fe4m9p5", secondary: "Button_buttonStyle_variant_secondary__fe4m9p6", tertiary: "Button_buttonStyle_variant_tertiary__fe4m9p7", prio: "Button_buttonStyle_variant_prio__fe4m9p8", ghost: "Button_buttonStyle_variant_ghost__fe4m9p9" }, fullWidth: { true: "Button_buttonStyle_fullWidth_true__fe4m9pa" }, circle: { true: "Button_buttonStyle_circle_true__fe4m9pb" }, rounded: { true: "Button_buttonStyle_rounded_true__fe4m9pc" }, boxShadow: { true: "Button_buttonStyle_boxShadow_true__fe4m9pd", false: "Button_buttonStyle_boxShadow_false__fe4m9pe" } }, defaultVariants: { size: "medium", variant: "primary", boxShadow: false }, compoundVariants: [[{ circle: true, size: "small" }, "Button_buttonStyle_compound_0__fe4m9pf"], [{ circle: true, size: "medium" }, "Button_buttonStyle_compound_1__fe4m9pg"], [{ circle: true, size: "large" }, "Button_buttonStyle_compound_2__fe4m9ph"], [{ boxShadow: true, size: "small" }, "Button_buttonStyle_compound_3__fe4m9pi"], [{ boxShadow: true, size: "medium" }, "Button_buttonStyle_compound_4__fe4m9pj"], [{ boxShadow: true, size: "large" }, "Button_buttonStyle_compound_5__fe4m9pk"], [{ circle: true, rounded: true }, "Button_buttonStyle_compound_6__fe4m9pl"]] });
|
|
6
|
+
var childrenContainer = createRuntimeFn({ defaultClassName: "Button_childrenContainer__fe4m9pm", variantClassNames: { loading: { true: "Button_childrenContainer_loading_true__fe4m9pn" } }, defaultVariants: {}, compoundVariants: [] });
|
|
7
|
+
var spinnerContainer = "Button_spinnerContainer__fe4m9po";
|
|
7
8
|
|
|
8
|
-
export {
|
|
9
|
+
export { badgeContainer, buttonStyle, childrenContainer, spinnerContainer };
|
|
@@ -1,21 +1,9 @@
|
|
|
1
|
+
import { TButtonRoot } from './Button.types.js';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
buttonRef?: React.Ref<HTMLButtonElement>;
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
className?: string;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
flexReverse?: boolean;
|
|
10
|
-
fullWidth?: boolean;
|
|
11
|
-
icon?: React.ReactNode;
|
|
4
|
+
declare const Button: React.ForwardRefExoticComponent<{
|
|
5
|
+
badge?: string;
|
|
12
6
|
loading?: boolean;
|
|
13
|
-
|
|
14
|
-
round?: boolean;
|
|
15
|
-
shouldPreventDefault?: boolean;
|
|
16
|
-
size?: 'small' | 'medium' | 'icon' | 'large';
|
|
17
|
-
variant?: 'primary' | 'secondary' | 'ghost' | 'tertiary' | 'prio' | 'dark';
|
|
18
|
-
};
|
|
19
|
-
declare const Button: ({ ariaLabel, buttonRef, children, className, disabled, flexReverse, fullWidth, icon, loading, onClick, round, shouldPreventDefault, size, variant }: TCgButton) => JSX.Element;
|
|
7
|
+
} & TButtonRoot & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
20
8
|
|
|
21
|
-
export { Button
|
|
9
|
+
export { Button };
|
|
@@ -1,55 +1,46 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { button, buttonContent, buttonLoader } from './Button.css.vanilla.js';
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
3
2
|
import { Spinner } from '../Spinner/Spinner.js';
|
|
3
|
+
import { EButtonSize, EButtonVariant } from './Button.types.js';
|
|
4
|
+
import { buttonStyle, childrenContainer, spinnerContainer, badgeContainer } from './Button.css.vanilla.js';
|
|
4
5
|
|
|
5
|
-
const Button = (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{
|
|
24
|
-
"aria-label": ariaLabel,
|
|
25
|
-
className: `${button({
|
|
26
|
-
buttonPadding: size,
|
|
27
|
-
buttonRadius: round ? "round" : "default",
|
|
28
|
-
buttonShadow: variant === "ghost" || variant === "secondary" ? "none" : size === "small" ? "small" : "default",
|
|
29
|
-
buttonVariant: variant,
|
|
30
|
-
fullWidth
|
|
31
|
-
})} ${className}`,
|
|
32
|
-
disabled: disabled || loading,
|
|
33
|
-
onClick: (e) => {
|
|
34
|
-
shouldPreventDefault && e.preventDefault();
|
|
35
|
-
onClick && onClick();
|
|
36
|
-
},
|
|
37
|
-
ref: buttonRef
|
|
38
|
-
},
|
|
39
|
-
/* @__PURE__ */ React.createElement(
|
|
40
|
-
"div",
|
|
6
|
+
const Button = forwardRef(
|
|
7
|
+
({
|
|
8
|
+
badge,
|
|
9
|
+
children,
|
|
10
|
+
loading,
|
|
11
|
+
size = EButtonSize.medium,
|
|
12
|
+
type = "button",
|
|
13
|
+
variant = EButtonVariant.primary,
|
|
14
|
+
boxShadow,
|
|
15
|
+
circle,
|
|
16
|
+
fullWidth,
|
|
17
|
+
rounded,
|
|
18
|
+
className,
|
|
19
|
+
...props
|
|
20
|
+
}, ref) => {
|
|
21
|
+
const spinnerSize = size === EButtonSize.small ? "small" : size === EButtonSize.large ? "large" : "medium";
|
|
22
|
+
return /* @__PURE__ */ React.createElement(
|
|
23
|
+
"button",
|
|
41
24
|
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
25
|
+
disabled: loading,
|
|
26
|
+
ref,
|
|
27
|
+
type,
|
|
28
|
+
className: `${buttonStyle({
|
|
29
|
+
size,
|
|
30
|
+
variant,
|
|
31
|
+
boxShadow,
|
|
32
|
+
circle,
|
|
33
|
+
fullWidth,
|
|
34
|
+
rounded
|
|
35
|
+
})}${className ? ` ${className}` : ""}`,
|
|
36
|
+
...props
|
|
47
37
|
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
38
|
+
/* @__PURE__ */ React.createElement("div", { className: childrenContainer({ loading }) }, children),
|
|
39
|
+
loading && /* @__PURE__ */ React.createElement("span", { className: spinnerContainer }, /* @__PURE__ */ React.createElement(Spinner, { spinnerColor: "disabledGray", size: spinnerSize })),
|
|
40
|
+
badge && /* @__PURE__ */ React.createElement("div", { className: badgeContainer }, badge)
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
Button.displayName = "Button";
|
|
54
45
|
|
|
55
46
|
export { Button };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare enum EButtonSize {
|
|
2
|
+
small = "small",
|
|
3
|
+
medium = "medium",
|
|
4
|
+
large = "large"
|
|
5
|
+
}
|
|
6
|
+
declare enum EButtonVariant {
|
|
7
|
+
primary = "primary",
|
|
8
|
+
secondary = "secondary",
|
|
9
|
+
tertiary = "tertiary",
|
|
10
|
+
prio = "prio",
|
|
11
|
+
ghost = "ghost"
|
|
12
|
+
}
|
|
13
|
+
declare type TButtonRoot = {
|
|
14
|
+
boxShadow?: boolean;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
circle?: boolean;
|
|
17
|
+
fullWidth?: boolean;
|
|
18
|
+
rounded?: boolean;
|
|
19
|
+
size?: EButtonSize;
|
|
20
|
+
type?: 'button' | 'submit' | 'reset';
|
|
21
|
+
variant?: EButtonVariant;
|
|
22
|
+
};
|
|
23
|
+
declare type TButton = {
|
|
24
|
+
badge?: string;
|
|
25
|
+
loading?: boolean;
|
|
26
|
+
} & TButtonRoot & React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
27
|
+
declare type TChildrenContainer = Pick<TButton, 'loading'>;
|
|
28
|
+
|
|
29
|
+
export { EButtonSize, EButtonVariant, TButton, TButtonRoot, TChildrenContainer };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var EButtonSize = /* @__PURE__ */ ((EButtonSize2) => {
|
|
2
|
+
EButtonSize2["small"] = "small";
|
|
3
|
+
EButtonSize2["medium"] = "medium";
|
|
4
|
+
EButtonSize2["large"] = "large";
|
|
5
|
+
return EButtonSize2;
|
|
6
|
+
})(EButtonSize || {});
|
|
7
|
+
var EButtonVariant = /* @__PURE__ */ ((EButtonVariant2) => {
|
|
8
|
+
EButtonVariant2["primary"] = "primary";
|
|
9
|
+
EButtonVariant2["secondary"] = "secondary";
|
|
10
|
+
EButtonVariant2["tertiary"] = "tertiary";
|
|
11
|
+
EButtonVariant2["prio"] = "prio";
|
|
12
|
+
EButtonVariant2["ghost"] = "ghost";
|
|
13
|
+
return EButtonVariant2;
|
|
14
|
+
})(EButtonVariant || {});
|
|
15
|
+
|
|
16
|
+
export { EButtonSize, EButtonVariant };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
declare type TButtonAsLink = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
type?: 'button' | 'submit' | 'reset';
|
|
6
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
7
|
+
declare const ButtonAsLink: ({ children, type, className, ...props }: TButtonAsLink) => JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { ButtonAsLink, TButtonAsLink };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { buttonAsLink } from './ButtonAsLink.css.vanilla.js';
|
|
3
|
+
|
|
4
|
+
const ButtonAsLink = ({
|
|
5
|
+
children,
|
|
6
|
+
type = "button",
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}) => /* @__PURE__ */ React.createElement(
|
|
10
|
+
"button",
|
|
11
|
+
{
|
|
12
|
+
type,
|
|
13
|
+
className: `${buttonAsLink}${className ? ` ${className}` : ""}`,
|
|
14
|
+
...props
|
|
15
|
+
},
|
|
16
|
+
children
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export { ButtonAsLink };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TButtonRoot } from '../Button.types.js';
|
|
3
|
+
|
|
4
|
+
declare const DivAsButton: ({ boxShadow, children, circle, fullWidth, rounded, size, variant, className, ...props }: TButtonRoot & React.HTMLAttributes<HTMLDivElement>) => JSX.Element;
|
|
5
|
+
|
|
6
|
+
export { DivAsButton };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EButtonSize, EButtonVariant } from '../Button.types.js';
|
|
3
|
+
import { buttonStyle } from '../Button.css.vanilla.js';
|
|
4
|
+
|
|
5
|
+
const DivAsButton = ({
|
|
6
|
+
boxShadow,
|
|
7
|
+
children,
|
|
8
|
+
circle,
|
|
9
|
+
fullWidth,
|
|
10
|
+
rounded,
|
|
11
|
+
size = EButtonSize.medium,
|
|
12
|
+
variant = EButtonVariant.primary,
|
|
13
|
+
className,
|
|
14
|
+
...props
|
|
15
|
+
}) => /* @__PURE__ */ React.createElement(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
className: `${buttonStyle({
|
|
19
|
+
size,
|
|
20
|
+
variant,
|
|
21
|
+
boxShadow,
|
|
22
|
+
circle,
|
|
23
|
+
fullWidth,
|
|
24
|
+
rounded
|
|
25
|
+
})}${className ? ` ${className}` : ""}`,
|
|
26
|
+
...props
|
|
27
|
+
},
|
|
28
|
+
children
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
export { DivAsButton };
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { TSummaryItem } from '../CartItemSummary/CartItemSummary.js';
|
|
2
2
|
|
|
3
3
|
declare type TCartSummary = {
|
|
4
|
-
title?: string;
|
|
5
|
-
subTitle?: string;
|
|
6
4
|
bags?: TSummaryItem[];
|
|
7
|
-
groceries?: TSummaryItem[];
|
|
8
|
-
charges?: TSummaryItem[];
|
|
9
5
|
cateredMeals?: TSummaryItem[];
|
|
6
|
+
charges?: TSummaryItem[];
|
|
10
7
|
deliveryFee?: {
|
|
11
8
|
amount: number;
|
|
12
9
|
taxAmount: number;
|
|
13
10
|
taxPercentage: number;
|
|
14
11
|
totalDiscountAmount: number;
|
|
15
12
|
};
|
|
13
|
+
groceries?: TSummaryItem[];
|
|
14
|
+
saveLabel?: string;
|
|
15
|
+
shippingLabel?: string;
|
|
16
|
+
subtitle?: string;
|
|
17
|
+
taxLabel?: string;
|
|
18
|
+
title?: string;
|
|
16
19
|
totalAmount: number;
|
|
17
20
|
totalDiscount: number;
|
|
18
|
-
totalTaxAmount: number;
|
|
19
21
|
totalLabel?: string;
|
|
20
|
-
|
|
21
|
-
shippingLabel?: string;
|
|
22
|
-
saveLabel?: string;
|
|
22
|
+
totalTaxAmount: number;
|
|
23
23
|
};
|
|
24
24
|
declare function CartSummary({ saveLabel, shippingLabel, totalLabel, taxLabel, ...cartSummary }: TCartSummary): JSX.Element;
|
|
25
25
|
|
|
@@ -38,7 +38,7 @@ function CartSummary({
|
|
|
38
38
|
const sumOfBags = calculateSummaryLine(bags);
|
|
39
39
|
const sumOfGroceries = calculateSummaryLine(groceries);
|
|
40
40
|
const sumOfCateredMeals = calculateSummaryLine(cateredMeals);
|
|
41
|
-
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: cartPaymentContainer }, cartSummary.title && /* @__PURE__ */ React.createElement("div", { className: cartSummaryTitle }, /* @__PURE__ */ React.createElement(H3, null, cartSummary.title), /* @__PURE__ */ React.createElement(BodyText, null, cartSummary.
|
|
41
|
+
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: cartPaymentContainer }, cartSummary.title && /* @__PURE__ */ React.createElement("div", { className: cartSummaryTitle }, /* @__PURE__ */ React.createElement(H3, null, cartSummary.title), /* @__PURE__ */ React.createElement(BodyText, null, cartSummary.subtitle)), /* @__PURE__ */ React.createElement(
|
|
42
42
|
"div",
|
|
43
43
|
{
|
|
44
44
|
className: cartSummaryHeader({
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
.Flex_flex__g9z2i20 {
|
|
2
|
+
display: flex;
|
|
3
|
+
}
|
|
4
|
+
.Flex_flex_alignItems_baseline__g9z2i21 {
|
|
5
|
+
align-items: baseline;
|
|
6
|
+
}
|
|
7
|
+
.Flex_flex_alignItems_center__g9z2i22 {
|
|
8
|
+
align-items: center;
|
|
9
|
+
}
|
|
10
|
+
.Flex_flex_alignItems_flex-start__g9z2i23 {
|
|
11
|
+
align-items: flex-start;
|
|
12
|
+
}
|
|
13
|
+
.Flex_flex_alignItems_flex-end__g9z2i24 {
|
|
14
|
+
align-items: flex-end;
|
|
15
|
+
}
|
|
16
|
+
.Flex_flex_alignItems_stretch__g9z2i25 {
|
|
17
|
+
align-items: stretch;
|
|
18
|
+
}
|
|
19
|
+
.Flex_flex_justifyContent_center__g9z2i26 {
|
|
20
|
+
justify-content: center;
|
|
21
|
+
}
|
|
22
|
+
.Flex_flex_justifyContent_flex-start__g9z2i27 {
|
|
23
|
+
justify-content: flex-start;
|
|
24
|
+
}
|
|
25
|
+
.Flex_flex_justifyContent_flex-end__g9z2i28 {
|
|
26
|
+
justify-content: flex-end;
|
|
27
|
+
}
|
|
28
|
+
.Flex_flex_justifyContent_space-between__g9z2i29 {
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
}
|
|
31
|
+
.Flex_flex_justifyContent_space-around__g9z2i2a {
|
|
32
|
+
justify-content: space-around;
|
|
33
|
+
}
|
|
34
|
+
.Flex_flex_justifyContent_space-evenly__g9z2i2b {
|
|
35
|
+
justify-content: space-evenly;
|
|
36
|
+
}
|
|
37
|
+
.Flex_flex_direction_row__g9z2i2c {
|
|
38
|
+
flex-direction: row;
|
|
39
|
+
}
|
|
40
|
+
.Flex_flex_direction_column__g9z2i2d {
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import './Flex.css.ts.vanilla.css';
|
|
2
|
+
import { createRuntimeFn } from '@vanilla-extract/recipes/createRuntimeFn';
|
|
3
|
+
|
|
4
|
+
var flex = createRuntimeFn({ defaultClassName: "Flex_flex__g9z2i20", variantClassNames: { alignItems: { baseline: "Flex_flex_alignItems_baseline__g9z2i21", center: "Flex_flex_alignItems_center__g9z2i22", "flex-start": "Flex_flex_alignItems_flex-start__g9z2i23", "flex-end": "Flex_flex_alignItems_flex-end__g9z2i24", stretch: "Flex_flex_alignItems_stretch__g9z2i25" }, justifyContent: { center: "Flex_flex_justifyContent_center__g9z2i26", "flex-start": "Flex_flex_justifyContent_flex-start__g9z2i27", "flex-end": "Flex_flex_justifyContent_flex-end__g9z2i28", "space-between": "Flex_flex_justifyContent_space-between__g9z2i29", "space-around": "Flex_flex_justifyContent_space-around__g9z2i2a", "space-evenly": "Flex_flex_justifyContent_space-evenly__g9z2i2b" }, direction: { row: "Flex_flex_direction_row__g9z2i2c", column: "Flex_flex_direction_column__g9z2i2d" } }, defaultVariants: { alignItems: "flex-start", justifyContent: "flex-start", direction: "column" }, compoundVariants: [] });
|
|
5
|
+
|
|
6
|
+
export { flex };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
declare type TFlex = {
|
|
4
|
+
alignItems?: 'baseline' | 'center' | 'flex-start' | 'flex-end' | 'stretch';
|
|
5
|
+
gap?: number;
|
|
6
|
+
justifyContent?: 'center' | 'flex-start' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
7
|
+
row?: boolean;
|
|
8
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
9
|
+
declare const Flex: ({ children, className, alignItems, gap, justifyContent, row, style, ...props }: TFlex) => JSX.Element;
|
|
10
|
+
|
|
11
|
+
export { Flex, TFlex };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { flex } from './Flex.css.vanilla.js';
|
|
3
|
+
|
|
4
|
+
const Flex = ({
|
|
5
|
+
children,
|
|
6
|
+
className,
|
|
7
|
+
alignItems,
|
|
8
|
+
gap = 0,
|
|
9
|
+
justifyContent = "flex-start",
|
|
10
|
+
row,
|
|
11
|
+
style,
|
|
12
|
+
...props
|
|
13
|
+
}) => /* @__PURE__ */ React.createElement(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
...props,
|
|
17
|
+
className: `${flex({
|
|
18
|
+
alignItems: alignItems ?? (row ? "center" : "flex-start"),
|
|
19
|
+
justifyContent,
|
|
20
|
+
direction: row ? "row" : "column"
|
|
21
|
+
})}${className ? ` ${className}` : ""}`,
|
|
22
|
+
style: { ...style, gap }
|
|
23
|
+
},
|
|
24
|
+
children
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export { Flex };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button } from '../Button/Button.js';
|
|
3
|
+
import { EButtonVariant } from '../Button/Button.types.js';
|
|
3
4
|
import { Icons } from '@citygross/icons_v2';
|
|
4
5
|
import { wrapper, headerWrapper, headerContainer, mobileLogo, desktopLogo, headerButtonContainer, menuIconContainer } from './Header.css.vanilla.js';
|
|
5
6
|
|
|
@@ -9,14 +10,7 @@ const Header = ({
|
|
|
9
10
|
onMenuClick,
|
|
10
11
|
sideModal,
|
|
11
12
|
headerLink
|
|
12
|
-
}) => /* @__PURE__ */ React.createElement("div", { className: wrapper }, headerLink && headerLink, /* @__PURE__ */ React.createElement("div", { className: headerWrapper }, /* @__PURE__ */ React.createElement("div", { className: headerContainer }, /* @__PURE__ */ React.createElement("span", { className: mobileLogo }, /* @__PURE__ */ React.createElement(Icons.LogoFlat, { small: true })), /* @__PURE__ */ React.createElement("span", { className: desktopLogo }, /* @__PURE__ */ React.createElement(Icons.Logo, null)), /* @__PURE__ */ React.createElement("div", { className: headerButtonContainer }, btnLabel && /* @__PURE__ */ React.createElement(
|
|
13
|
-
Button,
|
|
14
|
-
{
|
|
15
|
-
onClick: btnOnClick,
|
|
16
|
-
variant: "secondary"
|
|
17
|
-
},
|
|
18
|
-
btnLabel
|
|
19
|
-
), /* @__PURE__ */ React.createElement(
|
|
13
|
+
}) => /* @__PURE__ */ React.createElement("div", { className: wrapper }, headerLink && headerLink, /* @__PURE__ */ React.createElement("div", { className: headerWrapper }, /* @__PURE__ */ React.createElement("div", { className: headerContainer }, /* @__PURE__ */ React.createElement("span", { className: mobileLogo }, /* @__PURE__ */ React.createElement(Icons.LogoFlat, { small: true })), /* @__PURE__ */ React.createElement("span", { className: desktopLogo }, /* @__PURE__ */ React.createElement(Icons.Logo, null)), /* @__PURE__ */ React.createElement("div", { className: headerButtonContainer }, btnLabel && /* @__PURE__ */ React.createElement(Button, { onClick: btnOnClick, variant: EButtonVariant.secondary }, btnLabel), /* @__PURE__ */ React.createElement(
|
|
20
14
|
"div",
|
|
21
15
|
{
|
|
22
16
|
className: menuIconContainer,
|
|
@@ -10,7 +10,7 @@ declare type TModal = {
|
|
|
10
10
|
isConfirm?: boolean;
|
|
11
11
|
onBackdropClick?: () => void;
|
|
12
12
|
querySelector?: string;
|
|
13
|
-
|
|
13
|
+
subtitle?: string;
|
|
14
14
|
title?: string;
|
|
15
15
|
};
|
|
16
16
|
declare const Modal: React.ForwardRefExoticComponent<TModal & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -16,7 +16,7 @@ const Modal = forwardRef(
|
|
|
16
16
|
isConfirm,
|
|
17
17
|
onBackdropClick,
|
|
18
18
|
querySelector = "#root",
|
|
19
|
-
|
|
19
|
+
subtitle,
|
|
20
20
|
title
|
|
21
21
|
}, ref) => {
|
|
22
22
|
const domSafe = typeof document !== "undefined";
|
|
@@ -46,7 +46,7 @@ const Modal = forwardRef(
|
|
|
46
46
|
onClick: () => onBackdropClick && onBackdropClick()
|
|
47
47
|
},
|
|
48
48
|
/* @__PURE__ */ React.createElement(Icons.Cross, null)
|
|
49
|
-
)), /* @__PURE__ */ React.createElement(BodyText, null,
|
|
49
|
+
)), /* @__PURE__ */ React.createElement(BodyText, null, subtitle)),
|
|
50
50
|
children && /* @__PURE__ */ React.createElement("div", { className: childrenWrapper }, children),
|
|
51
51
|
footer && /* @__PURE__ */ React.createElement(Fragment, null, /* @__PURE__ */ React.createElement(Spacer, null), /* @__PURE__ */ React.createElement("div", { className: footerWrapper }, footer))
|
|
52
52
|
)
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
.
|
|
2
|
-
padding: 0 4px;
|
|
3
|
-
}
|
|
4
|
-
.Pagination_leftPaginationButtonWrapper__139elee1 {
|
|
5
|
-
padding: 0 4px;
|
|
6
|
-
width: 44px;
|
|
7
|
-
}
|
|
8
|
-
.Pagination_flex__139elee2 {
|
|
1
|
+
.Pagination_paginationContainer__139elee0 {
|
|
9
2
|
display: flex;
|
|
10
|
-
align-items:
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 24px;
|
|
11
5
|
justify-content: center;
|
|
12
|
-
}
|
|
13
|
-
.Pagination_paginationButton__139elee3 {
|
|
14
|
-
width: 32px;
|
|
15
|
-
height: 32px;
|
|
16
6
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import './Pagination.css.ts.vanilla.css';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var leftPaginationButtonWrapper = "Pagination_leftPaginationButtonWrapper__139elee1";
|
|
5
|
-
var paginationButton = "Pagination_paginationButton__139elee3";
|
|
6
|
-
var paginationButtonWrapper = "Pagination_paginationButtonWrapper__139elee0";
|
|
3
|
+
var paginationContainer = "Pagination_paginationContainer__139elee0";
|
|
7
4
|
|
|
8
|
-
export {
|
|
5
|
+
export { paginationContainer };
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
1
|
declare type TPagination = {
|
|
4
|
-
totalItems?: number;
|
|
5
|
-
fetchItems: (page: number) => void;
|
|
6
2
|
currentPage: number;
|
|
3
|
+
fetchItems: (page: number) => void;
|
|
7
4
|
itemsPerPage?: number;
|
|
5
|
+
onPageChange?: (page: number) => void;
|
|
6
|
+
pageLabel?: string;
|
|
8
7
|
setPage?: (page: number) => void;
|
|
9
|
-
|
|
10
|
-
rightIcon?: React.ReactNode;
|
|
11
|
-
leftIcon?: React.ReactNode;
|
|
8
|
+
totalItems?: number;
|
|
12
9
|
};
|
|
13
|
-
declare function Pagination({
|
|
10
|
+
declare function Pagination({ currentPage, fetchItems, itemsPerPage, onPageChange, pageLabel, setPage, totalItems }: TPagination): JSX.Element;
|
|
14
11
|
|
|
15
12
|
export { Pagination, TPagination };
|
|
@@ -1,82 +1,66 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Icons } from '@citygross/icons_v2';
|
|
3
|
+
import { palette } from '@citygross/design-tokens_v2';
|
|
4
|
+
import { BodyText } from '../../typography/BodyText/BodyText.js';
|
|
4
5
|
import { Button } from '../Button/Button.js';
|
|
6
|
+
import { EButtonVariant } from '../Button/Button.types.js';
|
|
7
|
+
import { paginationContainer } from './Pagination.css.vanilla.js';
|
|
5
8
|
|
|
6
|
-
function createPagination(totalItems, itemsPerPage, numOfPaginationsToShow) {
|
|
7
|
-
const amountOfPages = Math.ceil((totalItems || 0) / (itemsPerPage ?? 6));
|
|
8
|
-
if (amountOfPages === 0 || itemsPerPage === 0) {
|
|
9
|
-
return [];
|
|
10
|
-
}
|
|
11
|
-
const pagination = [];
|
|
12
|
-
let block = [];
|
|
13
|
-
let counter = 0;
|
|
14
|
-
new Array(amountOfPages).fill(0).map((_, index) => {
|
|
15
|
-
if (counter < (numOfPaginationsToShow ?? 4) - 1) {
|
|
16
|
-
counter++;
|
|
17
|
-
block.push(index);
|
|
18
|
-
if (index === amountOfPages - 1) {
|
|
19
|
-
pagination.push(block);
|
|
20
|
-
}
|
|
21
|
-
} else {
|
|
22
|
-
counter = 0;
|
|
23
|
-
block.push(index);
|
|
24
|
-
pagination.push(block);
|
|
25
|
-
block = [];
|
|
26
|
-
}
|
|
27
|
-
return null;
|
|
28
|
-
});
|
|
29
|
-
return pagination;
|
|
30
|
-
}
|
|
31
9
|
function Pagination({
|
|
32
|
-
totalItems,
|
|
33
10
|
currentPage,
|
|
34
11
|
fetchItems,
|
|
35
|
-
itemsPerPage,
|
|
12
|
+
itemsPerPage = 10,
|
|
13
|
+
onPageChange,
|
|
14
|
+
pageLabel = "Sida",
|
|
36
15
|
setPage,
|
|
37
|
-
|
|
38
|
-
rightIcon,
|
|
39
|
-
leftIcon
|
|
16
|
+
totalItems
|
|
40
17
|
}) {
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
18
|
+
const totalPages = Math.ceil((totalItems || 0) / itemsPerPage);
|
|
19
|
+
const hasNextPage = currentPage < totalPages;
|
|
20
|
+
const hasPrevPage = currentPage > 1;
|
|
21
|
+
const handlePageChange = (page) => {
|
|
22
|
+
setPage?.(page);
|
|
23
|
+
fetchItems(page);
|
|
24
|
+
onPageChange?.(page);
|
|
25
|
+
};
|
|
26
|
+
if (totalPages === 0) return null;
|
|
27
|
+
return /* @__PURE__ */ React.createElement("nav", { "aria-label": "Paginering", className: paginationContainer }, /* @__PURE__ */ React.createElement(
|
|
50
28
|
Button,
|
|
51
29
|
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
className: paginationButton
|
|
30
|
+
"aria-label": "F\xF6reg\xE5ende sida",
|
|
31
|
+
circle: true,
|
|
32
|
+
disabled: !hasPrevPage,
|
|
33
|
+
onClick: () => handlePageChange(currentPage - 1),
|
|
34
|
+
variant: hasPrevPage ? EButtonVariant.secondary : EButtonVariant.ghost
|
|
59
35
|
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
))), pagination.length > 1 && currentIndex < pagination.length - 1 && rightIcon && /* @__PURE__ */ React.createElement("div", { className: paginationButtonWrapper }, /* @__PURE__ */ React.createElement(
|
|
36
|
+
/* @__PURE__ */ React.createElement(
|
|
37
|
+
Icons.ChevronLeft,
|
|
38
|
+
{
|
|
39
|
+
"aria-hidden": "true",
|
|
40
|
+
color: hasPrevPage ? palette.darkest : palette.placeholder,
|
|
41
|
+
height: 20,
|
|
42
|
+
width: 20
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
), /* @__PURE__ */ React.createElement(BodyText, { "aria-atomic": "true", "aria-live": "polite", color: "darkest" }, pageLabel, " ", currentPage, " av ", totalPages), /* @__PURE__ */ React.createElement(
|
|
71
46
|
Button,
|
|
72
47
|
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
48
|
+
"aria-label": "N\xE4sta sida",
|
|
49
|
+
circle: true,
|
|
50
|
+
variant: hasNextPage ? EButtonVariant.secondary : EButtonVariant.ghost,
|
|
51
|
+
disabled: !hasNextPage,
|
|
52
|
+
onClick: () => handlePageChange(currentPage + 1)
|
|
77
53
|
},
|
|
78
|
-
|
|
79
|
-
|
|
54
|
+
/* @__PURE__ */ React.createElement(
|
|
55
|
+
Icons.ChevronRight,
|
|
56
|
+
{
|
|
57
|
+
"aria-hidden": "true",
|
|
58
|
+
color: hasNextPage ? palette.darkest : palette.placeholder,
|
|
59
|
+
height: 20,
|
|
60
|
+
width: 20
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
));
|
|
80
64
|
}
|
|
81
65
|
|
|
82
66
|
export { Pagination };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
declare const margin: Record<"xxxs" | "xxs" | "xxs2" | "xs" | "xs2" | "sm" | "sm2" | "md" | "lg" | "xl" | "xxl"
|
|
2
|
-
declare const marginHorizontal: Record<"xxxs" | "xxs" | "xxs2" | "xs" | "xs2" | "sm" | "sm2" | "md" | "lg" | "xl" | "xxl"
|
|
3
|
-
declare const marginVertical: Record<"xxxs" | "xxs" | "xxs2" | "xs" | "xs2" | "sm" | "sm2" | "md" | "lg" | "xl" | "xxl"
|
|
4
|
-
declare const marginBottomDynamic: Record<"xxxs" | "xxs" | "xxs2" | "xs" | "xs2" | "sm" | "sm2" | "md" | "lg" | "xl" | "xxl"
|
|
5
|
-
declare const padding: Record<"xxxs" | "xxs" | "xxs2" | "xs" | "xs2" | "sm" | "sm2" | "md" | "lg" | "xl" | "xxl"
|
|
6
|
-
declare const paddingHorizontal: Record<"xxxs" | "xxs" | "xxs2" | "xs" | "xs2" | "sm" | "sm2" | "md" | "lg" | "xl" | "xxl"
|
|
7
|
-
declare const paddingVertical: Record<"xxxs" | "xxs" | "xxs2" | "xs" | "xs2" | "sm" | "sm2" | "md" | "lg" | "xl" | "xxl"
|
|
1
|
+
declare const margin: Record<"false" | "xxxs" | "xxs" | "xxs2" | "xs" | "xs2" | "sm" | "sm2" | "md" | "lg" | "xl" | "xxl", string>;
|
|
2
|
+
declare const marginHorizontal: Record<"false" | "xxxs" | "xxs" | "xxs2" | "xs" | "xs2" | "sm" | "sm2" | "md" | "lg" | "xl" | "xxl", string>;
|
|
3
|
+
declare const marginVertical: Record<"false" | "xxxs" | "xxs" | "xxs2" | "xs" | "xs2" | "sm" | "sm2" | "md" | "lg" | "xl" | "xxl", string>;
|
|
4
|
+
declare const marginBottomDynamic: Record<"false" | "xxxs" | "xxs" | "xxs2" | "xs" | "xs2" | "sm" | "sm2" | "md" | "lg" | "xl" | "xxl", string>;
|
|
5
|
+
declare const padding: Record<"false" | "xxxs" | "xxs" | "xxs2" | "xs" | "xs2" | "sm" | "sm2" | "md" | "lg" | "xl" | "xxl", string>;
|
|
6
|
+
declare const paddingHorizontal: Record<"false" | "xxxs" | "xxs" | "xxs2" | "xs" | "xs2" | "sm" | "sm2" | "md" | "lg" | "xl" | "xxl", string>;
|
|
7
|
+
declare const paddingVertical: Record<"false" | "xxxs" | "xxs" | "xxs2" | "xs" | "xs2" | "sm" | "sm2" | "md" | "lg" | "xl" | "xxl", string>;
|
|
8
8
|
|
|
9
9
|
export { margin, marginBottomDynamic, marginHorizontal, marginVertical, padding, paddingHorizontal, paddingVertical };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
declare type TTextDecoration = 'underline' | 'lineThrough';
|
|
2
2
|
declare type TTextAlign = 'center' | 'left' | 'right';
|
|
3
3
|
declare type TBodyTextSizeKeys = 'tiny' | 'extraSmall' | 'small' | 'default';
|
|
4
|
-
declare const fontFamily: Record<"display" | "
|
|
5
|
-
declare const fontSize: Record<"
|
|
4
|
+
declare const fontFamily: Record<"display" | "code" | "primary", string>;
|
|
5
|
+
declare const fontSize: Record<"code" | "xs" | "s1" | "s2" | "s3" | "s4" | "m1" | "m2" | "l1", string>;
|
|
6
6
|
declare const fontWeight: Record<"bold" | "medium" | "regular" | "semiBold", string>;
|
|
7
7
|
declare const lineHeight: Record<"xs" | "s1" | "s2" | "m1" | "m2" | "l1" | "m3", string>;
|
|
8
8
|
declare const textAlign: Record<"left" | "right" | "center", string>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
export { AlertBox, TAlertBox } from './components/AlertBox/AlertBox.js';
|
|
2
1
|
export { Accordion, TAccordion } from './components/Accordion/Accordion.js';
|
|
2
|
+
export { AlertBox, TAlertBox } from './components/AlertBox/AlertBox.js';
|
|
3
3
|
export { Box, TBox } from './components/Box/Box.js';
|
|
4
4
|
export { BoxArrow, TBoxArrow } from './components/BoxArrow/BoxArrow.js';
|
|
5
|
-
export { Button
|
|
5
|
+
export { Button } from './components/Button/Button.js';
|
|
6
|
+
export { EButtonSize, EButtonVariant, TButton, TButtonRoot, TChildrenContainer } from './components/Button/Button.types.js';
|
|
7
|
+
export { ButtonAsLink, TButtonAsLink } from './components/Button/ButtonAsLink/ButtonAsLink.js';
|
|
8
|
+
export { DivAsButton } from './components/Button/DivAsButton/DivAsButton.js';
|
|
6
9
|
export { CartItemSummary, TCartItemSummary, TSummaryItem } from './components/CartItemSummary/CartItemSummary.js';
|
|
7
10
|
export { CartSummary, TCartSummary } from './components/CartSummary/CartSummary.js';
|
|
8
|
-
export { EmptyBox, TEmptyBox } from './components/EmptyBox/EmptyBox.js';
|
|
9
11
|
export { Divider, TDivider } from './components/Divider/Divider.js';
|
|
10
12
|
export { Dot, TDot } from './components/Dot/Dot.js';
|
|
13
|
+
export { EmptyBox, TEmptyBox } from './components/EmptyBox/EmptyBox.js';
|
|
14
|
+
export { Flex, TFlex } from './components/Flex/Flex.js';
|
|
11
15
|
export { FormControl, TFormControl, TScreenWidth } from './components/FormControl/FormControl.js';
|
|
12
16
|
export { Header, THeader } from './components/Header/Header.js';
|
|
13
17
|
export { HeaderCheckout, THeaderCheckout } from './components/Header/HeaderCheckout.js';
|
|
@@ -24,12 +28,12 @@ export { Skeleton, TSkeleton } from './components/Skeleton/Skeleton.js';
|
|
|
24
28
|
export { Spacer, TSpacer } from './components/Spacer/Spacer.js';
|
|
25
29
|
export { Spinner, TSpinner } from './components/Spinner/Spinner.js';
|
|
26
30
|
export { TTimeline, TTimelineItem, Timeline } from './components/TimeLine/TimeLine.js';
|
|
27
|
-
export { BodyText, TBodyText } from './typography/BodyText/BodyText.js';
|
|
28
|
-
export { H1, TH1 } from './typography/H1/H1.js';
|
|
29
|
-
export { H2, TH2 } from './typography/H2/H2.js';
|
|
30
|
-
export { H3, TH3 } from './typography/H3/H3.js';
|
|
31
31
|
export { TBodyTextSizeKeys, TTextAlign, TTextDecoration, bodyTextSize, fontFamily, fontSize, fontWeight, lineHeight, textAlign, textDecoration } from './cssUtils/typography.css.js';
|
|
32
32
|
export { backgroundColor, color, hoverBackgroundColor, hoverColor } from './cssUtils/color.css.js';
|
|
33
33
|
export { borderColor, borderRadius } from './cssUtils/border.css.js';
|
|
34
34
|
export { margin, marginBottomDynamic, marginHorizontal, marginVertical, padding, paddingHorizontal, paddingVertical } from './cssUtils/spacings.css.js';
|
|
35
35
|
export { customToCssMapper, spacingsToCssMapper } from './cssUtils/utils.js';
|
|
36
|
+
export { BodyText, TBodyText } from './typography/BodyText/BodyText.js';
|
|
37
|
+
export { H1, TH1 } from './typography/H1/H1.js';
|
|
38
|
+
export { H2, TH2 } from './typography/H2/H2.js';
|
|
39
|
+
export { H3, TH3 } from './typography/H3/H3.js';
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
export { AlertBox } from './components/AlertBox/AlertBox.js';
|
|
2
1
|
export { Accordion } from './components/Accordion/Accordion.js';
|
|
2
|
+
export { AlertBox } from './components/AlertBox/AlertBox.js';
|
|
3
3
|
export { Box } from './components/Box/Box.js';
|
|
4
4
|
export { BoxArrow } from './components/BoxArrow/BoxArrow.js';
|
|
5
5
|
export { Button } from './components/Button/Button.js';
|
|
6
|
+
export { EButtonSize, EButtonVariant } from './components/Button/Button.types.js';
|
|
7
|
+
export { ButtonAsLink } from './components/Button/ButtonAsLink/ButtonAsLink.js';
|
|
8
|
+
export { DivAsButton } from './components/Button/DivAsButton/DivAsButton.js';
|
|
6
9
|
export { CartItemSummary } from './components/CartItemSummary/CartItemSummary.js';
|
|
7
10
|
export { CartSummary } from './components/CartSummary/CartSummary.js';
|
|
8
|
-
export { EmptyBox } from './components/EmptyBox/EmptyBox.js';
|
|
9
11
|
export { Divider } from './components/Divider/Divider.js';
|
|
10
12
|
export { Dot } from './components/Dot/Dot.js';
|
|
13
|
+
export { EmptyBox } from './components/EmptyBox/EmptyBox.js';
|
|
14
|
+
export { Flex } from './components/Flex/Flex.js';
|
|
11
15
|
export { FormControl, TScreenWidth } from './components/FormControl/FormControl.js';
|
|
12
16
|
export { Header } from './components/Header/Header.js';
|
|
13
17
|
export { HeaderCheckout } from './components/Header/HeaderCheckout.js';
|
|
@@ -24,12 +28,12 @@ export { Skeleton } from './components/Skeleton/Skeleton.js';
|
|
|
24
28
|
export { Spacer } from './components/Spacer/Spacer.js';
|
|
25
29
|
export { Spinner } from './components/Spinner/Spinner.js';
|
|
26
30
|
export { Timeline } from './components/TimeLine/TimeLine.js';
|
|
27
|
-
export { BodyText } from './typography/BodyText/BodyText.js';
|
|
28
|
-
export { H1 } from './typography/H1/H1.js';
|
|
29
|
-
export { H2 } from './typography/H2/H2.js';
|
|
30
|
-
export { H3 } from './typography/H3/H3.js';
|
|
31
31
|
export { bodyTextSize, fontFamily, fontSize, fontWeight, lineHeight, textAlign, textDecoration } from './cssUtils/typography.css.vanilla.js';
|
|
32
32
|
export { backgroundColor, color, hoverBackgroundColor, hoverColor } from './cssUtils/color.css.vanilla.js';
|
|
33
33
|
export { borderColor, borderRadius } from './cssUtils/border.css.vanilla.js';
|
|
34
34
|
export { margin, marginBottomDynamic, marginHorizontal, marginVertical, padding, paddingHorizontal, paddingVertical } from './cssUtils/spacings.css.vanilla.js';
|
|
35
35
|
export { customToCssMapper, spacingsToCssMapper } from './cssUtils/utils.js';
|
|
36
|
+
export { BodyText } from './typography/BodyText/BodyText.js';
|
|
37
|
+
export { H1 } from './typography/H1/H1.js';
|
|
38
|
+
export { H2 } from './typography/H2/H2.js';
|
|
39
|
+
export { H3 } from './typography/H3/H3.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citygross/components_v2",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,17 +28,17 @@
|
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@storybook/addon-a11y": "^6.
|
|
32
|
-
"@storybook/addon-actions": "^6.
|
|
33
|
-
"@storybook/addon-controls": "^6.
|
|
34
|
-
"@storybook/addon-docs": "^6.
|
|
35
|
-
"@storybook/addon-essentials": "^6.
|
|
36
|
-
"@storybook/addon-links": "^6.
|
|
37
|
-
"@storybook/addon-viewport": "^6.
|
|
38
|
-
"@storybook/addons": "^6.
|
|
31
|
+
"@storybook/addon-a11y": "^6.5.16",
|
|
32
|
+
"@storybook/addon-actions": "^6.5.16",
|
|
33
|
+
"@storybook/addon-controls": "^6.5.16",
|
|
34
|
+
"@storybook/addon-docs": "^6.5.16",
|
|
35
|
+
"@storybook/addon-essentials": "^6.5.16",
|
|
36
|
+
"@storybook/addon-links": "^6.5.16",
|
|
37
|
+
"@storybook/addon-viewport": "^6.5.16",
|
|
38
|
+
"@storybook/addons": "^6.5.16",
|
|
39
39
|
"@storybook/builder-webpack5": "^6.5.16",
|
|
40
40
|
"@storybook/manager-webpack5": "^6.5.16",
|
|
41
|
-
"@storybook/react": "^6.
|
|
41
|
+
"@storybook/react": "^6.5.16",
|
|
42
42
|
"@storybook/storybook-deployer": "^2.8.7",
|
|
43
43
|
"@testing-library/jest-dom": "^5.10.1",
|
|
44
44
|
"@testing-library/react": "^12.0.0",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"react-slick": "^0.30.1",
|
|
78
78
|
"slick-carousel": "^1.8.1"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "78d618c78176dc6c6b96c3cfaacc02b2247cb914"
|
|
81
81
|
}
|