Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(input): update disabled style #1336

Merged
merged 21 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a2ea22f
chore(base-input): update disabled style
RyushiAok Jul 2, 2024
abb1c50
chore(search-selector): update disabled style
RyushiAok Jul 3, 2024
5761e3a
chore(search-input): update disabled style
RyushiAok Jul 3, 2024
c70f16e
chore(selectbox): update disabled style
RyushiAok Jul 3, 2024
eae7a03
fix(search-input): icon color
RyushiAok Jul 3, 2024
12cabc1
chore(date-picker): update disabled style
RyushiAok Jul 3, 2024
5e5d140
chore(date-range-picker): update disabled style
RyushiAok Jul 3, 2024
5a72fb1
chore(time-picker): update disabled style
RyushiAok Jul 3, 2024
123cad0
Merge branch 'main' of https://github.com/Wizleap-Inc/wiz-ui into cho…
RyushiAok Jul 3, 2024
d933a18
docs(date-range-picker, vue): v-bind args
RyushiAok Jul 5, 2024
0702ea8
docs(search-input): add disabled-with-values story
RyushiAok Jul 5, 2024
349976d
docs(search-selector): add disabled-with-values story
RyushiAok Jul 5, 2024
53ced21
chore(text-area): disabled style
RyushiAok Jul 5, 2024
bef1d56
Merge branch 'main' of https://github.com/Wizleap-Inc/wiz-ui into cho…
RyushiAok Jul 5, 2024
095779c
fix(search-input): icon
RyushiAok Jul 5, 2024
933f115
fix(password-input): hide default eye icon
RyushiAok Jul 28, 2024
2d52e82
fix(password-input): cursor not-allowed
RyushiAok Jul 28, 2024
5ed4d07
chore: add changeset
RyushiAok Jul 28, 2024
c8a907d
fix(password-input): hide password when disabled
RyushiAok Jul 28, 2024
f9178c8
Merge branch 'main' of https://github.com/Wizleap-Inc/wiz-ui into cho…
ichi-h Oct 31, 2024
06c1e69
chore: type-errorの解消
ichi-h Oct 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/friendly-poets-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@wizleap-inc/wiz-ui-react": minor
"@wizleap-inc/wiz-ui-next": minor
"@wizleap-inc/wiz-ui-styles": minor
---

chore: update disabled styles
19 changes: 14 additions & 5 deletions packages/styles/bases/base-input.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ export const baseInputStyle = style({
color: THEME.color.gray[500],
fontSize: `calc((${THEME.fontSize.sm} + ${THEME.fontSize.xs}) / 2)`,
},
":disabled": {
opacity: 0.5,
color: THEME.color.gray[700],
backgroundColor: THEME.color.gray[300],
cursor: "not-allowed",
},
selectors: {
"&:disabled::placeholder": {
color: THEME.color.gray[700],
},
"&::-ms-reveal": {
display: "none",
},
},
});

export const baseInputPaddingStyle = styleVariants({
Expand All @@ -30,8 +44,3 @@ export const baseInputPaddingStyle = styleVariants({
padding: `${THEME.spacing.sm} ${THEME.spacing.xs}`,
},
});

export const baseInputDisabledStyle = style({
backgroundColor: THEME.color.gray[300],
cursor: "not-allowed",
});
8 changes: 6 additions & 2 deletions packages/styles/bases/date-picker-input.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ export const datePickerVariantStyle = styleVariants({
cursor: "pointer",
},
disabled: {
color: THEME.color.gray["500"],
background: THEME.color.gray["300"],
opacity: 0.5,
color: THEME.color.gray[700],
backgroundColor: THEME.color.gray[300],
cursor: "not-allowed",
},
});
Expand Down Expand Up @@ -102,4 +103,7 @@ export const datePickerCancelIconStyle = style({
":active": {
fill: THEME.color.green["800"],
},
":disabled": {
cursor: "not-allowed",
},
});
13 changes: 12 additions & 1 deletion packages/styles/bases/date-range-picker.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export const bodyStyle = styleVariants({
disabled: [
baseBodyStyle,
{
background: THEME.color.gray["300"],
opacity: 0.5,
color: THEME.color.gray[700],
backgroundColor: THEME.color.gray[300],
cursor: "not-allowed",
},
],
Expand Down Expand Up @@ -63,6 +65,12 @@ export const inputTextStyle = styleVariants({
color: THEME.color.gray["800"],
},
],
disabled: [
inputTextBaseStyle,
{
color: "inherit",
},
],
});

export const popupStyle = style({
Expand Down Expand Up @@ -199,4 +207,7 @@ export const popupCalendarCancelIconStyle = style({
":active": {
fill: THEME.color.green["800"],
},
":disabled": {
cursor: "not-allowed",
},
});
3 changes: 3 additions & 0 deletions packages/styles/bases/password-input.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export const passwordVisibleIconStyle = style({
height: THEME.fontSize.xl2,
padding: THEME.spacing.no,
fill: THEME.color.gray["400"],
":disabled": {
cursor: "not-allowed",
},
});

export const passwordVisibleIconActiveStyle = style({
Expand Down
8 changes: 7 additions & 1 deletion packages/styles/bases/search-input.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export const searchInputStyle = style({
});

export const searchInputDisabledStyle = style({
opacity: 0.5,
color: THEME.color.gray[700],
backgroundColor: THEME.color.gray[300],
cursor: "not-allowed",
});
Expand All @@ -42,7 +44,6 @@ export const searchInputIconStyle = style({
lineHeight: THEME.fontSize.xl2,
width: THEME.fontSize.xl2,
height: THEME.fontSize.xl2,
fill: THEME.color.gray["400"],
});

export const searchContainerStyle = style({
Expand Down Expand Up @@ -301,4 +302,9 @@ export const searchInputInnerInputStyle = style({
cursor: "not-allowed",
backgroundColor: THEME.color.gray["300"],
},
selectors: {
"&:disabled::placeholder": {
color: THEME.color.gray[700],
},
},
});
10 changes: 8 additions & 2 deletions packages/styles/bases/search-selector.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ export const selectBoxStyle = style({
});

export const selectBoxDisabledStyle = style({
color: THEME.color.gray["700"],
backgroundColor: THEME.color.gray["300"],
opacity: 0.5,
color: THEME.color.gray[700],
backgroundColor: THEME.color.gray[300],
});

export const selectBoxCursorStyle = styleVariants({
Expand Down Expand Up @@ -145,6 +146,11 @@ export const selectBoxSearchInputStyle = style({
cursor: "not-allowed",
backgroundColor: THEME.color.gray["300"],
},
selectors: {
"&:disabled::placeholder": {
color: THEME.color.gray[700],
},
},
});

export const selectBoxAddStyle = style({
Expand Down
8 changes: 7 additions & 1 deletion packages/styles/bases/selectbox-input.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export const selectBoxStyle = style({
});

export const selectBoxDisabledStyle = style({
color: THEME.color.gray["700"],
opacity: 0.5,
color: THEME.color.gray[700],
backgroundColor: THEME.color.gray["300"],
});

Expand Down Expand Up @@ -87,6 +88,11 @@ export const selectBoxSelectorOptionStyle = style({
color: THEME.color.gray["400"],
cursor: "not-allowed",
},
selectors: {
"&:disabled::placeholder": {
color: THEME.color.gray[700],
},
},
});

export const selectBoxPlaceholderStyle = style({
Expand Down
18 changes: 9 additions & 9 deletions packages/styles/bases/text-area.css.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { style, styleVariants } from "@vanilla-extract/css";
import { style } from "@vanilla-extract/css";
import { THEME } from "@wizleap-inc/wiz-ui-constants";

export const textAreaStyle = style({
Expand All @@ -8,21 +8,21 @@ export const textAreaStyle = style({
padding: THEME.spacing.xs,
fontSize: THEME.fontSize.sm,
lineHeight: 1.5,

color: THEME.color.gray[700],
"::placeholder": {
color: THEME.color.gray[500],
},
});

export const textAreaVariantStyle = styleVariants({
default: {
":disabled": {
opacity: 0.5,
color: THEME.color.gray[700],
},
disabled: {
backgroundColor: THEME.color.gray[300],
color: THEME.color.gray[500],
cursor: "not-allowed",
},
selectors: {
"&:disabled::placeholder": {
color: THEME.color.gray[700],
},
},
});

export const textAreaExpandStyle = style({
Expand Down
13 changes: 7 additions & 6 deletions packages/styles/bases/time-picker-input.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export const timePickerStyle = style({
});

export const timePickerDisabledStyle = style({
backgroundColor: THEME.color.gray["300"],
opacity: 0.5,
color: THEME.color.gray[700],
backgroundColor: THEME.color.gray[300],
});

export const timePickerCursorStyle = styleVariants({
Expand All @@ -35,7 +37,7 @@ export const timePickerBoxColorStyle = styleVariants({
color: THEME.color.gray["800"],
},
disabled: {
color: THEME.color.gray["500"],
color: THEME.color.gray["700"],
},
});

Expand Down Expand Up @@ -119,8 +121,7 @@ export const cancelButtonStyle = style({
":active": {
fill: THEME.color.green["800"],
},
});

export const cancelButtonDisabledStyle = style({
cursor: "not-allowed",
":disabled": {
cursor: "not-allowed",
},
});
8 changes: 3 additions & 5 deletions packages/wiz-ui-next/src/components/base/inputs/base/base.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:class="[
baseInputStyle,
baseInputPaddingStyle[spaceType],
disabled && baseInputDisabledStyle,
inputBorderStyle[state],
]"
:style="{ width: computedWidth }"
Expand All @@ -19,14 +18,13 @@
</template>

<script setup lang="ts">
import { ComponentName, AutoCompleteKeys } from "@wizleap-inc/wiz-ui-constants";
import { AutoCompleteKeys, ComponentName } from "@wizleap-inc/wiz-ui-constants";
import {
baseInputStyle,
baseInputDisabledStyle,
baseInputPaddingStyle,
baseInputStyle,
} from "@wizleap-inc/wiz-ui-styles/bases/base-input.css";
import { inputBorderStyle } from "@wizleap-inc/wiz-ui-styles/commons";
import { computed, PropType } from "vue";
import { PropType, computed } from "vue";

defineOptions({
name: ComponentName.BaseInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ export const InitialValueRange: StoryFn<typeof WizDateRangePicker> = (
template: `
<div style="display: flex; gap: 20rem; flex-direction: column; height: 90rem">
<WizDateRangePicker
v-bind="args"
v-model="dateRange1"
v-model:selectBoxValue="selectBoxValue1"
:selectBoxOptions="selectBoxOptions"
Expand Down Expand Up @@ -358,6 +359,7 @@ export const InitialValueRange2: StoryFn<typeof WizDateRangePicker> = (
template: `
<div style="display: flex; gap: 20rem; flex-direction: column; height: 90rem">
<WizDateRangePicker
v-bind="args"
v-model="dateRange1"
v-model:selectBoxValue="selectBoxValue1"
:selectBoxOptions="selectBoxOptions"
Expand Down Expand Up @@ -394,6 +396,7 @@ export const InitialValueStart: StoryFn<typeof WizDateRangePicker> = (
template: `
<div style="display: flex; gap: 20rem; flex-direction: column; height: 90rem">
<WizDateRangePicker
v-bind="args"
v-model="dateRange3"
v-model:selectBoxValue="selectBoxValue3"
:selectBoxOptions="selectBoxOptions"
Expand All @@ -406,6 +409,53 @@ export const InitialValueStart: StoryFn<typeof WizDateRangePicker> = (
`,
});

export const Hover: StoryFn<typeof WizDateRangePicker> = (args) => ({
components: { WizDateRangePicker },
setup() {
const dateRange = ref<DateRange>({
start: new Date(2020, 0, 15),
end: new Date(2020, 1, 15),
});
const selectBoxValue = ref<string>();

const isOpen = ref(true);
const isHover = ref(true);
const updateIsOpen = (value: boolean) => {
isOpen.value = value;
};
const updateIsHover = (value: boolean) => {
isHover.value = value;
};
return {
dateRange,
selectBoxValue,
selectBoxOptions,
isOpen,
isHover,
updateIsOpen,
updateIsHover,
args,
};
},
template: `
<div>
<WizDateRangePicker

v-bind="args"
v-model="dateRange"
v-model:selectBoxValue="selectBoxValue"
:selectBoxOptions="selectBoxOptions"
:isOpen="isOpen"
:isHover="isHover"
@update:modelValue="args.onDateSelected"
@update:isOpen="updateIsOpen"
@update:isHover="updateIsHover"
@update:selectBoxValue="args.onSelectBoxValueChange"
/>
</div>
`,
});

export const Test: StoryFn<typeof WizDateRangePicker> = (args) => ({
components: { WizDateRangePicker },
setup() {
Expand Down Expand Up @@ -437,6 +487,7 @@ export const Test: StoryFn<typeof WizDateRangePicker> = (args) => ({
template: `
<div>
<WizDateRangePicker
v-bind="args"
v-model="dateRange"
v-model:selectBoxValue="selectBoxValue"
:selectBoxOptions="selectBoxOptions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
<span
:class="
styles.inputTextStyle[
modelValue.start && !disabled ? 'selected' : 'default'
(disabled && 'disabled') ||
(modelValue.start && 'selected') ||
'default'
]
"
>{{
Expand All @@ -31,7 +33,9 @@
<span
:class="
styles.inputTextStyle[
modelValue.end && !disabled ? 'selected' : 'default'
(disabled && 'disabled') ||
(modelValue.end && 'selected') ||
'default'
]
"
>{{ modelValue.end ? formatDate(modelValue.end) : "終了日" }}</span
Expand Down
Loading
Loading