Skip to content

Commit f33d058

Browse files
committed
Merge remote-tracking branch 'origin/main' into stepper-component-update-wider--line-space
2 parents 5ca12f6 + 9f8c906 commit f33d058

File tree

9 files changed

+100
-6
lines changed

9 files changed

+100
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tableflow/ui-library",
3-
"version": "1.45.0",
3+
"version": "1.48.0",
44
"description": "A library of frontend components used by TableFlow",
55
"repository": {
66
"type": "git",

src/Button/style/Button.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
}
5858

5959
&:is([disabled]) {
60-
background-color: var(--color-primary-disabled);
61-
color: var(--color-text-on-primary-disabled);
60+
background-color: var(--color-primary-button-disabled);
61+
color: var(--color-text-on-primary-button-disabled);
6262
}
6363
}
6464

src/Checkbox/Checkbox.stories.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { ComponentMeta, ComponentStory } from "@storybook/react";
2+
import { iconsArray } from "../Icon/types";
3+
import CheckboxComponent from ".";
4+
import { CheckboxProps } from "./types";
5+
6+
export default {
7+
title: "User Interface/Checkbox",
8+
component: CheckboxComponent,
9+
} as ComponentMeta<typeof CheckboxComponent>;
10+
11+
const Template: ComponentStory<typeof CheckboxComponent> = (args: CheckboxProps) => <CheckboxComponent {...args} />;
12+
13+
export const Checkbox = Template.bind({});
14+
Checkbox.args = {
15+
label: "Text",
16+
};

src/Checkbox/index.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import classes from "../utils/classes";
2+
import { CheckboxProps } from "./types";
3+
import style from "./style/Checkbox.module.scss";
4+
5+
export default function Checkbox({ label, className, ...props }: CheckboxProps) {
6+
const containerClasses = classes([style.container, className]);
7+
8+
return (
9+
<label className={containerClasses}>
10+
<input type="checkbox" {...props} />
11+
<span>{label}</span>
12+
</label>
13+
);
14+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
.container {
2+
display: inline-block;
3+
gap: var(--m-xs);
4+
align-items: center;
5+
6+
&:has(input:not(:disabled)) {
7+
cursor: pointer;
8+
}
9+
10+
input[type="checkbox"] {
11+
-webkit-appearance: none;
12+
appearance: none;
13+
background-color: transparent;
14+
margin: 0;
15+
color: var(--color-primary);
16+
width: var(--m);
17+
height: var(--m);
18+
border: 2px solid var(--color-border);
19+
display: grid;
20+
place-content: center;
21+
border-radius: var(--border-radius-1);
22+
cursor: pointer;
23+
24+
&::before {
25+
content: "";
26+
width: var(--m-xs);
27+
height: var(--m-xs);
28+
}
29+
30+
&:checked {
31+
background-color: var(--color-primary);
32+
border-color: var(--color-primary);
33+
}
34+
35+
&:checked::before {
36+
clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
37+
box-shadow: inset 1em 1em var(--color-input-background);
38+
}
39+
40+
//&:not(:disabled) {
41+
// &:focus {
42+
// outline: 1px solid var(--color-border);
43+
// outline-offset: 3px;
44+
// }
45+
//}
46+
47+
&:disabled {
48+
--container-color: var(--container-disabled);
49+
color: var(--container-disabled);
50+
cursor: default;
51+
background-color: var(--color-input-disabled);
52+
}
53+
}
54+
}

src/Checkbox/types/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { InputHTMLAttributes, ReactElement } from "react";
2+
3+
export type CheckboxProps = InputHTMLAttributes<HTMLInputElement> & {
4+
label?: string | ReactElement;
5+
};

src/Input/style/Input.module.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
.inputWrapper {
3131
background-color: var(--color-input-background);
3232
border-radius: var(--border-radius-2);
33-
outline: 2px solid transparent;
33+
outline: 1px solid transparent;
3434
padding: calc(var(--m-xxs) / 2);
3535
border: 1px solid var(--color-border);
3636
font-weight: 400;
@@ -172,12 +172,13 @@
172172
background-color: var(--color-input-background);
173173
border-radius: var(--border-radius-2);
174174
padding: var(--m-xxxxs);
175-
outline: 2px solid var(--color-text);
175+
outline: 1px solid var(--color-border);
176176
display: flex;
177177
flex-direction: column;
178178
gap: var(--m-xxxxs);
179179
max-height: calc(100vh - 8px);
180180
overflow-y: auto;
181+
margin-top: var(--m-xxxxs);
181182
}
182183

183184
.option {

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import "./style/index.scss";
2727
import Badge from "./Badge";
2828
import Box from "./Box";
2929
import Button from "./Button";
30+
import Checkbox from "./Checkbox";
3031
import Dialog from "./Dialog";
3132
import Errors from "./Errors";
3233
import Icon from "./Icon";
@@ -48,6 +49,7 @@ export {
4849
Badge,
4950
Box,
5051
Button,
52+
Checkbox,
5153
Dialog,
5254
Errors,
5355
Frame,
@@ -65,7 +67,7 @@ export {
6567
Tabs,
6668
TagEditor,
6769
ThemeToggle,
68-
Tooltip
70+
Tooltip,
6971
};
7072

7173
export {

src/style/themes/common.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
--color-primary-hover: #{$primary-700};
66
--color-primary-focus: #{$primary-600};
77
--color-primary-disabled: #{$primary-200};
8+
--color-primary-button-disabled: #3f3b55;
89

910
--color-secondary: #{$gray-800};
1011
--color-secondary-hover: #{$gray-600};
@@ -15,6 +16,7 @@
1516

1617
--color-text-on-primary: #{$base-white};
1718
--color-text-on-primary-disabled: #{$gray-500};
19+
--color-text-on-primary-button-disabled: #{$base-white};
1820

1921
--color-text-on-secondary: #{$gray-100};
2022
--color-text-on-secondary-disabled: #{$gray-600};

0 commit comments

Comments
 (0)