Skip to content

Commit

Permalink
Merge pull request #23 from tuzkituan/dev/select
Browse files Browse the repository at this point in the history
Dev/select
  • Loading branch information
tuzkituan authored Nov 3, 2023
2 parents aa8c9f1 + 292a4f2 commit 49d2e7f
Show file tree
Hide file tree
Showing 14 changed files with 1,492 additions and 719 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"plugin:storybook/recommended"
],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parser: "@typescript-eslint/parser",
Expand Down
8 changes: 3 additions & 5 deletions .storybook/YourTheme.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// .storybook/YourTheme.js

import { create } from "@storybook/theming/create";

export default create({
base: "light",
brandTitle: "ZENI-UI BY LEWIS",
base: "dark",
brandTitle: "ZENI-UI",
brandTarget: "_self",
appBg: "#F6F4EB",
// appBg: "#F6F4EB",
appBorderRadius: 8,
});
5 changes: 2 additions & 3 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const config: StorybookConfig = {
"@storybook/addon-essentials",
"@storybook/addon-onboarding",
"@storybook/addon-interactions",
"storybook-dark-mode",
],
framework: {
name: "@storybook/react-vite",
Expand All @@ -16,9 +17,7 @@ const config: StorybookConfig = {
docs: {
autodocs: "tag",
},
core: {
builder: "@storybook/builder-vite", // 👈 The builder enabled here.
},
core: {},
async viteFinal(config, { configType }) {
// if (configType === 'DEVELOPMENT') {
// // Your development configuration goes here
Expand Down
8 changes: 8 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { Preview } from "@storybook/react";
import "../lib/customization/global.css";
import { ZeniProvider } from "../lib/main";
import React from "react";
import { themes } from "@storybook/theming";

const preview: Preview = {
decorators: [
Expand All @@ -19,6 +20,13 @@ const preview: Preview = {
date: /Date$/,
},
},
darkMode: {
current: "dark",
dark: themes.dark,
light: themes.light,
stylePreview: true,

},
},
};

Expand Down
2 changes: 1 addition & 1 deletion lib/components/number-input/number-input.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Meta, StoryObj } from "@storybook/react";
import { NumberInput } from "./number-input";

const meta = {
title: "INPUTS/NumberInput",
title: "FORMS/NumberInput",
component: NumberInput,
tags: ["autodocs"],
argTypes: {
Expand Down
39 changes: 38 additions & 1 deletion lib/components/select/select.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ const meta = {
title: "FORMS/Select",
component: Select,
tags: ["autodocs"],
argTypes: {},
argTypes: {
placement: {
options: ["top", "bottom"],
control: "radio",
},
},
} satisfies Meta<typeof Select>;

export default meta;
Expand All @@ -19,6 +24,9 @@ export const Primary: Story = {
isClearable: true,
isSearchable: false,
// leftElement: <MapPinLine />,
placeholder: "This is the placeholder",
placement: "bottom",
isMultiple: false,
options: [
{
label: "This is a really long option label, you see?",
Expand All @@ -31,11 +39,40 @@ export const Primary: Story = {
{
label: "Option 3",
value: 3,
isDisabled: true,
},
{
label: "Option 4",
value: 4,
},
{
label: "Option 5",
value: 5,
},
{
label: "Option 6",
value: 6,
},
{
label: "Option 7",
value: 7,
},
{
label: "Option 8",
value: 8,
},
{
label: "Option 9",
value: 9,
},
{
label: "Option 10",
value: 10,
},
{
label: "Option 11",
value: 11,
},
],
},
};
Loading

0 comments on commit 49d2e7f

Please sign in to comment.