Skip to content

Commit

Permalink
Merge pull request #652 from pixiv/yue/replace-token1-modify
Browse files Browse the repository at this point in the history
fix: update design token usage
  • Loading branch information
yue4u authored Nov 20, 2024
2 parents 178fe0d + df4f644 commit ce5294c
Show file tree
Hide file tree
Showing 32 changed files with 166 additions and 119 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/bundle-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: Bundle Size

on:
pull_request:
branches:
- main
- v4.0.0

jobs:
build:
Expand All @@ -23,5 +20,5 @@ jobs:

# sourcemap は見ない
# d.ts はたまに異常な数の union 型が展開されるとかは検知したいが見なくて良いかもしれない
pattern: './packages/**/dist/**/*.{ts,js,cjs}'
pattern: './packages/*/dist/**/*.{ts,js,cjs}'
exclude: '{**/node_modules/**}'
3 changes: 0 additions & 3 deletions .github/workflows/docs-hosting-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: Deploy to Preview Channel

on:
pull_request:
branches:
- main
- v4.0.0

env:
WORKLOAD_IDENTITY_PROVIDER: 'projects/643536859873/locations/global/workloadIdentityPools/charcoal/providers/github-actions'
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: test-storybook
on:
pull_request:
types: [labeled, unlabeled, opened, synchronize, reopened]
branches:
- main
- v4.0.0

concurrency:
group: ${{ github.ref }}
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
- main

pull_request:
branches:
- main
- v4.0.0

jobs:
build:
Expand Down
17 changes: 8 additions & 9 deletions packages/react/src/components/Button/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,15 @@
font-size: 14px;
line-height: 22px;
font-weight: bold;
color: var(--charcoal-color-text-secondary-default);
background-color: var(--charcoal-color-container-secondary-default);
color: var(--charcoal-color-text-default);
background-color: var(--charcoal-color-container-secondary-default-a);
transition: 0.2s color, 0.2s background-color, 0.2s box-shadow;
height: 40px;
}

.charcoal-button:disabled {
cursor: default;
color: var(--charcoal-color-text-disable);
background-color: var(--charcoal-color-container-disable);
opacity: 0.32;
}

.charcoal-button:not(:disabled):focus-visible {
Expand All @@ -42,14 +41,14 @@
}

.charcoal-button:not(:disabled):hover {
color: var(--charcoal-color-text-secondary-hover);
background-color: var(--charcoal-color-container-secondary-hover);
color: var(--charcoal-color-text-hover);
background-color: var(--charcoal-color-container-secondary-hover-a);
}

.charcoal-button:not(:disabled):active,
.charcoal-button[data-active='true'] {
color: var(--charcoal-color-text-secondary-press);
background-color: var(--charcoal-color-container-secondary-press);
.charcoal-button:not(:disabled)[data-active='true'] {
color: var(--charcoal-color-text-press);
background-color: var(--charcoal-color-container-secondary-press-a);
}

.charcoal-button[data-variant='Primary'] {
Expand Down
34 changes: 26 additions & 8 deletions packages/react/src/components/Checkbox/CheckboxInput/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,21 @@
transition: 0.2s box-shadow, 0.2s background-color;
position: relative;
box-sizing: border-box;
background-color: var(--charcoal-color-container-default);
}

.charcoal-checkbox-input:disabled,
.charcoal-checkbox-input:hover {
background-color: var(--charcoal-color-container-hover);
}
.charcoal-checkbox-input:active {
background-color: var(--charcoal-color-container-press);
}
.charcoal-checkbox-input:disabled {
cursor: default;
}
.charcoal-checkbox-input[readonly] {
cursor: default;
background-color: var(--charcoal-color-container-disable);
opacity: 0.32;
}

.charcoal-checkbox-input:checked {
Expand All @@ -23,7 +32,7 @@

.charcoal-checkbox-input:checked::after {
content: '';
background-color: white;
background-color: var(--charcoal-color-icon-on-primary-default);
display: flex;
margin: auto;
width: 16px;
Expand All @@ -33,6 +42,14 @@
);
}

.charcoal-checkbox-input:checked:hover::after {
background-color: var(--charcoal-color-icon-on-primary-hover);
}

.charcoal-checkbox-input:checked:active::after {
background-color: var(--charcoal-color-icon-on-primary-press);
}

.charcoal-checkbox-input:not(:checked) {
border-width: 2px;
border-style: solid;
Expand All @@ -46,17 +63,18 @@
.charcoal-checkbox-input:not(:disabled):focus-visible {
box-shadow: var(--charcoal-color-custom-focus-effect);
}
.charcoal-checkbox-input:not(:disabled):focus:not(:focus-visible) {
box-shadow: none;
}

.charcoal-checkbox-input:checked:not(:disabled):hover {
.charcoal-checkbox-input:checked:not(:disabled, :read-only):hover {
background-color: var(--charcoal-color-container-primary-hover);
}
.charcoal-checkbox-input:checked:not(:disabled):active {
.charcoal-checkbox-input:checked:not(:disabled, :read-only):active {
background-color: var(--charcoal-color-container-primary-press);
}

.charcoal-checkbox-input:not(:disabled):focus:not(:focus-visible) {
box-shadow: none;
}

.charcoal-checkbox-input[aria-invalid='true'],
.charcoal-checkbox-input[aria-invalid='true']:not(:disabled):focus {
box-shadow: var(--charcoal-color-custom-error-effect);
Expand Down
8 changes: 6 additions & 2 deletions packages/react/src/components/Checkbox/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
cursor: pointer;
display: flex;
gap: 4px;
color: var(--charcoal-color-text-secondary-default);
color: var(--charcoal-color-text-default);
}

.charcoal-checkbox__label[aria-disabled='true'] {
cursor: default;
color: var(--charcoal-color-text-disable);
opacity: 0.32;
}

.charcoal-checkbox__label:has(input[readonly]) {
cursor: default;
}

.charcoal-checkbox__label_div {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ exports[`Storybook Tests > react/Clickable > Button 1`] = `
<button
className="charcoal-clickable"
onClick={[Function]}
style={
Object {
"color": "var(--charcoal-color-text-secondary-default)",
}
}
>
button
</button>
Expand All @@ -21,6 +26,11 @@ exports[`Storybook Tests > react/Clickable > Link 1`] = `
className="charcoal-clickable"
href="#"
onClick={[Function]}
style={
Object {
"color": "var(--charcoal-color-text-secondary-default)",
}
}
>
link
</a>
Expand Down
20 changes: 18 additions & 2 deletions packages/react/src/components/Clickable/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,28 @@ export default {
} as Meta<typeof Clickable>

export const Button: StoryObj = {
render: () => <Clickable onClick={action('click')}>button</Clickable>,
render: () => (
<Clickable
style={{
color: 'var(--charcoal-color-text-secondary-default)',
}}
onClick={action('click')}
>
button
</Clickable>
),
}

export const Link: StoryObj = {
render: () => (
<Clickable component="a" href="#" onClick={action('click')}>
<Clickable
style={{
color: 'var(--charcoal-color-text-secondary-default)',
}}
component="a"
href="#"
onClick={action('click')}
>
link
</Clickable>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@

.charcoal-list-item[aria-disabled='true'] {
cursor: default;
color: var(--charcoal-color-text-disable);
background-color: var(--charcoal-color-container-disable);
opacity: 0.32;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
overflow: auto;
max-height: inherit;
background-color: var(--charcoal-color-background-default);
border: solid 1px var(--charcoal-color-border-default);
border: solid 1px var(--charcoal-color-border-secondary);
border-radius: 8px;
padding-top: 8px;
padding-bottom: 8px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,9 @@ exports[`Storybook Tests > react/DropdownSelector > Default 1`] = `
<label
className="charcoal-field-label"
id="test-id"
/>
>
Label
</label>
<div
className="charcoal-field-label-sub-label"
>
Expand Down Expand Up @@ -315,8 +317,10 @@ exports[`Storybook Tests > react/DropdownSelector > Default 1`] = `
>
<span
className="charcoal-ui-dropdown-selector-text"
data-placeholder={false}
/>
data-placeholder={true}
>
Placeholder
</span>
<pixiv-icon
class="charcoal-ui-dropdown-selector-icon"
name="16/Menu"
Expand Down
14 changes: 7 additions & 7 deletions packages/react/src/components/DropdownSelector/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
grid-template-columns: 1fr;
grid-gap: 4px;
width: 100%;
border-radius: 4px;
}

.charcoal-dropdown-selector-root[aria-disabled='true'] {
cursor: default;
color: var(--charcoal-color-text-disable);
background-color: var(--charcoal-color-container-disable);
opacity: 0.32;
}

.charcoal-dropdown-selector-button {
Expand All @@ -26,7 +26,7 @@

padding-right: 8px;
padding-left: 8px;
background-color: var(--charcoal-color-container-secondary-default);
background-color: var(--charcoal-color-container-secondary-default-a);
border-radius: 4px;

transition: 0.2s box-shadow, 0.2s background-color;
Expand All @@ -47,11 +47,11 @@

.charcoal-dropdown-selector-button:not(:disabled)[data-active='true'],
.charcoal-dropdown-selector-button:not(:disabled):active {
background-color: var(--charcoal-color-container-secondary-press);
background-color: var(--charcoal-color-container-secondary-press-a);
}

.charcoal-dropdown-selector-button:not(:disabled):hover {
background-color: var(--charcoal-color-container-secondary-hover);
background-color: var(--charcoal-color-container-secondary-hover-a);
}

.charcoal-dropdown-selector-button:not(:disabled):focus:not(:focus-visible) {
Expand All @@ -70,7 +70,7 @@
font-size: 14px;
line-height: 22px;
display: flow-root;
color: var(--charcoal-color-text-secondary-default);
color: var(--charcoal-color-text-default);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
Expand All @@ -81,5 +81,5 @@
}

.charcoal-ui-dropdown-selector-icon {
color: var(--charcoal-color-text-secondary-default);
color: var(--charcoal-color-icon-secondary-default);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export const Default: StoryObj<typeof DropdownSelector> = {
{...args}
onChange={setSelected}
value={args.value ? args.value : selected}
placeholder="Placeholder"
label="Label"
>
<DropdownMenuItem value="1">Option 1</DropdownMenuItem>
<DropdownMenuItem value="2">Option 2</DropdownMenuItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@ exports[`Storybook Tests > react/IconButton > Default 1`] = `
</div>
`;

exports[`Storybook Tests > react/IconButton > Disabled 1`] = `
<div
data-dark={false}
>
<button
className="charcoal-icon-button"
data-active={false}
data-size="M"
data-variant="Default"
disabled={true}
>
<pixiv-icon
name="16/Add"
/>
</button>
</div>
`;

exports[`Storybook Tests > react/IconButton > IsActive 1`] = `
<div
data-dark={false}
Expand Down
Loading

0 comments on commit ce5294c

Please sign in to comment.