├── .nvmrc ├── .husky ├── .gitignore ├── pre-commit └── commit-msg ├── src ├── box │ ├── index.ts │ ├── __tests__ │ │ ├── __snapshots__ │ │ │ └── Box.test.tsx.snap │ │ └── Box.test.tsx │ ├── stories │ │ ├── BoxBasic.component.tsx │ │ ├── BoxAs.component.tsx │ │ ├── BoxAs.stories.tsx │ │ ├── BoxBasic.stories.tsx │ │ ├── BoxStyled.stories.tsx │ │ └── BoxStyled.component.tsx │ └── Box.tsx ├── tag │ ├── index.ts │ ├── stories │ │ ├── TagBasic.component.tsx │ │ └── TagStack.stories.tsx │ └── __tests__ │ │ └── Tag.test.tsx ├── badge │ ├── index.ts │ ├── __tests__ │ │ ├── Badge.test.tsx │ │ └── __snapshots__ │ │ │ └── Badge.test.tsx.snap │ └── stories │ │ ├── BadgeBasic.component.tsx │ │ └── BadgeStack.stories.tsx ├── __mocks__ │ ├── fileMock.js │ └── styleMock.js ├── divider │ ├── index.ts │ ├── __tests__ │ │ ├── __snapshots__ │ │ │ └── Divider.test.tsx.snap │ │ └── Divider.test.tsx │ └── stories │ │ ├── DividerBasic.component.tsx │ │ └── DividerVertical.component.tsx ├── spinner │ ├── index.ts │ ├── __tests__ │ │ ├── Spinner.test.tsx │ │ └── __snapshots__ │ │ │ └── Spinner.test.tsx.snap │ └── stories │ │ ├── SpinnerBasic.component.tsx │ │ └── SpinnerStack.stories.tsx ├── button-group │ ├── index.ts │ ├── __utils.tsx │ ├── stories │ │ └── ButtonGroupBasic.component.tsx │ └── __tests__ │ │ └── ButtonGroup.test.tsx ├── utils │ ├── object │ │ └── index.ts │ ├── index.ts │ ├── tailwindMerge.ts │ ├── debounce.ts │ ├── assertions.ts │ └── types.tsx ├── theme │ ├── index.ts │ ├── defaultTheme │ │ ├── icon.ts │ │ ├── buttonGroup.ts │ │ ├── tooltip.ts │ │ ├── divider.ts │ │ ├── checkboxGroup.ts │ │ ├── radioGroup.ts │ │ ├── circularProgress.ts │ │ ├── spinner.ts │ │ └── index.ts │ └── types.ts ├── create-icon │ ├── index.ts │ ├── __utils.tsx │ ├── __tests__ │ │ ├── __snapshots__ │ │ │ ├── createIcon.test.tsx.snap │ │ │ └── Icon.test.tsx.snap │ │ └── createIcon.test.tsx │ └── Icon.tsx ├── button │ ├── index.ts │ ├── stories │ │ ├── ButtonBasic.component.tsx │ │ ├── ButtonClose.component.tsx │ │ ├── ButtonLoadingA11y.component.tsx │ │ ├── ButtonStack.stories.tsx │ │ └── ButtonLoadingA11y.stories.tsx │ ├── __tests__ │ │ └── __snapshots__ │ │ │ └── Button.test.tsx.snap │ └── CloseButton.tsx ├── hooks │ ├── index.ts │ ├── usePrevious.tsx │ └── useMediaQuery.tsx ├── show-more │ ├── index.ts │ ├── ShowMore.tsx │ ├── ShowMoreUIState.tsx │ ├── stories │ │ ├── ShowMoreVertical.stories.tsx │ │ ├── ShowMoreHorizontal.stories.tsx │ │ └── ShowMoreHorizontal.component.tsx │ └── ShowMoreContent.tsx ├── avatar-group │ ├── index.ts │ ├── __utils.ts │ ├── stories │ │ ├── AvatarGroupIcon.component.tsx │ │ ├── AvatarGroupName.component.tsx │ │ ├── AvatarGroupBasic.component.tsx │ │ └── AvatarGroupStack.stories.tsx │ ├── AvatarGroupUIState.tsx │ ├── AvatarGroup.tsx │ └── AvatarGroupWrapper.tsx ├── tooltip │ ├── index.ts │ ├── stories │ │ ├── TooltipBasic.component.tsx │ │ └── TooltipAnchor.component.tsx │ ├── TooltipPrefix.tsx │ ├── TooltipSuffix.tsx │ ├── TooltipUIState.tsx │ ├── TooltipWrapper.tsx │ └── Tooltip.tsx ├── icons │ ├── Circle.tsx │ ├── Dot.tsx │ ├── ActiveStatus.tsx │ ├── stories │ │ ├── IconBasic.component.tsx │ │ ├── IconReactIcon.component.tsx │ │ ├── IconPath.component.tsx │ │ ├── IconAll.stories.tsx │ │ ├── IconPath.stories.tsx │ │ ├── IconBasic.stories.tsx │ │ ├── IconReactIcon.stories.tsx │ │ └── IconAll.component.tsx │ ├── Dash.tsx │ ├── AwayStatus.tsx │ ├── Equals.tsx │ ├── Photograph.tsx │ ├── Plus.tsx │ ├── SleepStatus.tsx │ ├── Check.tsx │ ├── CaretDown.tsx │ ├── CaretLeft.tsx │ ├── CaretRight.tsx │ ├── Moon.tsx │ ├── Clock.tsx │ ├── Select.tsx │ ├── Close.tsx │ ├── Error.tsx │ ├── CircledCheck.tsx │ ├── SliderThumbHandle.tsx │ ├── GenericAvatar.tsx │ ├── Timeless.tsx │ ├── User.tsx │ ├── index.ts │ ├── InfoCircle.tsx │ ├── EyesIcon.tsx │ ├── TypingSmallStatus.tsx │ └── Slot.tsx ├── radio-group │ ├── index.tsx │ ├── __utils.ts │ ├── stories │ │ ├── RadioGroupControlled.stories.tsx │ │ ├── RadioGroupDescription.component.tsx │ │ ├── RadioGroupDisabled.component.tsx │ │ └── RadioGroupBasic.component.tsx │ ├── RadioGroup.tsx │ ├── RadioGroupUIState.tsx │ └── RadioGroupWrapper.tsx ├── checkbox-group │ ├── index.ts │ ├── __utils.ts │ ├── stories │ │ ├── CheckboxGroupControlled.stories.tsx │ │ ├── CheckboxGroupTriBoolState.stories.tsx │ │ └── CheckboxGroupTriStringState.stories.tsx │ ├── CheckboxGroup.tsx │ ├── CheckboxGroupUIState.tsx │ └── CheckboxGroupWrapper.tsx ├── input │ ├── index.ts │ ├── __utils.tsx │ ├── stories │ │ └── InputBasic.component.tsx │ ├── Input.tsx │ └── InputWrapper.tsx ├── select │ ├── index.ts │ ├── __utils.tsx │ ├── stories │ │ └── SelectBasic.component.tsx │ ├── Select.tsx │ └── SelectWrapper.tsx ├── radio │ ├── __utils.tsx │ ├── stories │ │ └── RadioBasic.component.tsx │ ├── index.tsx │ ├── Radio.tsx │ ├── RadioInput.tsx │ └── RadioTextWrapper.tsx ├── progress │ ├── index.ts │ ├── stories │ │ └── ProgressBasic.component.tsx │ ├── ProgressUIState.tsx │ ├── Progress.tsx │ ├── ProgressHint.tsx │ ├── ProgressTrack.tsx │ ├── ProgressBar.tsx │ ├── ProgressLabel.tsx │ └── ProgressWrapper.tsx ├── meter │ ├── index.ts │ ├── stories │ │ └── MeterBasic.component.tsx │ ├── MeterHint.tsx │ ├── MeterTrack.tsx │ ├── MeterBarWrapper.tsx │ ├── MeterWrapper.tsx │ ├── MeterLabel.tsx │ └── MeterBar.tsx ├── switch │ ├── index.ts │ ├── stories │ │ ├── SwitchBasic.component.tsx │ │ └── SwitchControlled.stories.tsx │ ├── __tests__ │ │ └── __snapshots__ │ │ │ └── Switch.test.tsx.snap │ ├── Switch.tsx │ └── SwitchInput.tsx ├── textarea │ ├── index.ts │ ├── __utils.tsx │ ├── stories │ │ └── TextareaBasic.component.tsx │ ├── Textarea.tsx │ └── TextareaWrapper.tsx ├── checkbox │ ├── index.ts │ ├── stories │ │ ├── CheckboxBasic.component.tsx │ │ ├── CheckboxCustomMedium.stories.tsx │ │ ├── CheckboxCustomSimple.stories.tsx │ │ ├── CheckboxCustomAdvanced.stories.tsx │ │ └── CheckboxCustomSimple.component.tsx │ ├── __utils.tsx │ └── Checkbox.tsx ├── avatar │ ├── stories │ │ ├── AvatarBasic.component.tsx │ │ └── AvatarStack.component.tsx │ ├── index.ts │ ├── __utils.tsx │ ├── Avatar.tsx │ ├── AvatarIcon.tsx │ └── AvatarImage.tsx ├── slider │ ├── stories │ │ ├── SliderBasic.component.tsx │ │ └── SliderRange.component.tsx │ ├── index.ts │ ├── __utils.tsx │ ├── SliderThumbUIState.tsx │ ├── SliderThumbLabel.tsx │ ├── SliderTrack.tsx │ ├── SliderUIState.tsx │ ├── SliderWrapper.tsx │ └── SliderTrackWrapper.tsx ├── circular-progress │ ├── index.ts │ ├── stories │ │ ├── CircularProgressBasic.component.tsx │ │ └── CircularProgressCustom.stories.tsx │ ├── CircularProgressUIState.tsx │ ├── CircularProgress.tsx │ └── CircularProgressHint.ts └── index.ts ├── assets └── logo.png ├── .github └── CODEOWNERS ├── tsconfig.prod.json ├── .storybook ├── manager-head.html ├── manager.ts ├── tailwind.css ├── storybookTheme.ts ├── preview-head.html ├── preview.tsx └── main.ts ├── postcss.config.js ├── .size-limit.js ├── tailwind.config.js ├── tailwind-utils ├── animationDelay.js ├── animationDuration.js ├── utilities.js └── variants.js ├── .vscode ├── extensions.json └── settings.json ├── preset.d.ts ├── .kodiak.toml ├── adaptui.config.ts ├── .swcrc ├── .gitignore ├── renovate.json ├── .swcrc.build ├── scripts └── utils │ └── transpile-ts.js ├── .eslintignore ├── .prettierignore ├── tsconfig.json ├── jest.config.js ├── LICENSE ├── jest.setup.js ├── .all-contributorsrc ├── .eslintrc.json ├── babel.config.js └── .prettierrc.js /.nvmrc: -------------------------------------------------------------------------------- 1 | 16 2 | -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /src/box/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./Box"; 2 | -------------------------------------------------------------------------------- /src/tag/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./Tag"; 2 | -------------------------------------------------------------------------------- /src/badge/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./Badge"; 2 | -------------------------------------------------------------------------------- /src/__mocks__/fileMock.js: -------------------------------------------------------------------------------- 1 | module.exports = ""; 2 | -------------------------------------------------------------------------------- /src/__mocks__/styleMock.js: -------------------------------------------------------------------------------- 1 | module.exports = {}; 2 | -------------------------------------------------------------------------------- /src/divider/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./Divider"; 2 | -------------------------------------------------------------------------------- /src/spinner/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./Spinner"; 2 | -------------------------------------------------------------------------------- /assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adaptui/react-tailwind/HEAD/assets/logo.png -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx lint-staged 5 | -------------------------------------------------------------------------------- /src/button-group/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./__utils"; 2 | export * from "./ButtonGroup"; 3 | -------------------------------------------------------------------------------- /src/utils/object/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./defaults"; 2 | export * from "./mergeWith"; 3 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx commitlint --edit $1 5 | -------------------------------------------------------------------------------- /src/theme/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./provider"; 2 | export * from "./types"; 3 | export * from "./utils"; 4 | -------------------------------------------------------------------------------- /src/create-icon/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./__utils"; 2 | export * from "./createIcon"; 3 | export * from "./Icon"; 4 | -------------------------------------------------------------------------------- /src/button/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./Button"; 2 | export * from "./ButtonSpinner"; 3 | export * from "./CloseButton"; 4 | -------------------------------------------------------------------------------- /src/hooks/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./useImage"; 2 | export * from "./useMediaQuery"; 3 | export * from "./usePrevious"; 4 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Learn how to add code owners here: 2 | # https://help.github.com/en/articles/about-code-owners 3 | 4 | * @navin-moorthy 5 | -------------------------------------------------------------------------------- /src/theme/defaultTheme/icon.ts: -------------------------------------------------------------------------------- 1 | export const icon = { 2 | base: "w-[1em] h-[1em] inline-block leading-[1em] shrink-0 text-current align-middle", 3 | }; 4 | -------------------------------------------------------------------------------- /tsconfig.prod.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": ["src"], 4 | "exclude": ["**/*/stories", "**/*/__tests__", "**/*/utils"] 5 | } 6 | -------------------------------------------------------------------------------- /src/theme/defaultTheme/buttonGroup.ts: -------------------------------------------------------------------------------- 1 | export const buttonGroup = { 2 | base: "inline-flex rounded-lg", 3 | collapsed: "collapse-border", 4 | group: "space-x-1", 5 | }; 6 | -------------------------------------------------------------------------------- /.storybook/manager-head.html: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /.storybook/manager.ts: -------------------------------------------------------------------------------- 1 | import { addons } from "@storybook/addons"; 2 | import storybookTheme from "./storybookTheme"; 3 | 4 | addons.setConfig({ enableShortcuts: false, theme: storybookTheme }); 5 | -------------------------------------------------------------------------------- /.storybook/tailwind.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | @layer base { 6 | * { 7 | -webkit-tap-highlight-color: transparent; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/show-more/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./ShowMore"; 2 | export * from "./ShowMoreButton"; 3 | export * from "./ShowMoreContent"; 4 | export * from "./ShowMoreProps"; 5 | export * from "./ShowMoreUIState"; 6 | -------------------------------------------------------------------------------- /src/avatar-group/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./__utils"; 2 | export * from "./AvatarGroup"; 3 | export * from "./AvatarGroupProps"; 4 | export * from "./AvatarGroupUIState"; 5 | export * from "./AvatarGroupWrapper"; 6 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | require("tailwindcss"), 4 | require("postcss-flexbugs-fixes"), 5 | require("postcss-focus-visible"), 6 | require("autoprefixer"), 7 | ], 8 | }; 9 | -------------------------------------------------------------------------------- /.size-limit.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | { 3 | name: "Full", 4 | path: "out/esm/index.js", 5 | }, 6 | { 7 | name: "Button", 8 | path: "out/esm/index.js", 9 | import: "{ Button }", 10 | }, 11 | ]; 12 | -------------------------------------------------------------------------------- /src/tooltip/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./Tooltip"; 2 | export * from "./TooltipAnchor"; 3 | export * from "./TooltipArrow"; 4 | export * from "./TooltipProps"; 5 | export * from "./TooltipUIState"; 6 | export * from "./TooltipWrapper"; 7 | -------------------------------------------------------------------------------- /src/icons/Circle.tsx: -------------------------------------------------------------------------------- 1 | import { createIcon } from "../create-icon"; 2 | 3 | export const CircleIcon = createIcon({ 4 | displayName: "CircleIcon", 5 | viewBox: "0 0 8 8", 6 | path: , 7 | }); 8 | -------------------------------------------------------------------------------- /src/icons/Dot.tsx: -------------------------------------------------------------------------------- 1 | import { createIcon } from "../create-icon"; 2 | 3 | export const DotIcon = createIcon({ 4 | displayName: "DotIcon", 5 | viewBox: "0 0 9 9", 6 | path: , 7 | }); 8 | -------------------------------------------------------------------------------- /src/radio-group/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./__utils"; 2 | export * from "./RadioGroup"; 3 | export * from "./RadioGroupProps"; 4 | export * from "./RadioGroupUIState"; 5 | export * from "./RadioGroupWrapper"; 6 | export * from "./RadioShowMore"; 7 | -------------------------------------------------------------------------------- /src/checkbox-group/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./__utils"; 2 | export * from "./CheckboxGroup"; 3 | export * from "./CheckboxGroupProps"; 4 | export * from "./CheckboxGroupUIState"; 5 | export * from "./CheckboxGroupWrapper"; 6 | export * from "./CheckboxShowMore"; 7 | -------------------------------------------------------------------------------- /src/icons/ActiveStatus.tsx: -------------------------------------------------------------------------------- 1 | import { createIcon } from "../create-icon"; 2 | 3 | export const ActiveStatusIcon = createIcon({ 4 | displayName: "ActiveStatusIcon", 5 | viewBox: "0 0 4 4", 6 | path: , 7 | }); 8 | -------------------------------------------------------------------------------- /src/box/__tests__/__snapshots__/Box.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Box should render properly 1`] = ` 4 | 5 |
8 | AdaptUI 9 |
10 |
11 | `; 12 | -------------------------------------------------------------------------------- /src/utils/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./assertions"; 2 | export * from "./createContext"; 3 | export * from "./debounce"; 4 | export * from "./global-types"; 5 | export * from "./object"; 6 | export * from "./react"; 7 | export * from "./tailwindMerge"; 8 | export * from "./types"; 9 | -------------------------------------------------------------------------------- /src/input/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./__utils"; 2 | export * from "./Input"; 3 | export * from "./InputBase"; 4 | export * from "./InputPrefix"; 5 | export * from "./InputProps"; 6 | export * from "./InputSuffix"; 7 | export * from "./InputUIState"; 8 | export * from "./InputWrapper"; 9 | -------------------------------------------------------------------------------- /src/select/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./__utils"; 2 | export * from "./Select"; 3 | export * from "./SelectBase"; 4 | export * from "./SelectPrefix"; 5 | export * from "./SelectProps"; 6 | export * from "./SelectSuffix"; 7 | export * from "./SelectUIState"; 8 | export * from "./SelectWrapper"; 9 | -------------------------------------------------------------------------------- /src/radio/__utils.tsx: -------------------------------------------------------------------------------- 1 | import { CircleIcon } from "../icons"; 2 | 3 | import { RadioUIProps } from "./RadioProps"; 4 | 5 | export const RadioDefaultIcon: RadioUIProps["icon"] = props => { 6 | const { isChecked } = props; 7 | 8 | return <>{isChecked ? : null}; 9 | }; 10 | -------------------------------------------------------------------------------- /.storybook/storybookTheme.ts: -------------------------------------------------------------------------------- 1 | import { create } from "@storybook/theming"; 2 | 3 | export default create({ 4 | base: "light", 5 | brandTitle: "AdaptUI React Tailwind", 6 | brandUrl: "https://github.com/adaptui/react-tailwind", 7 | brandImage: "/logo.png", 8 | brandTarget: "_self", 9 | }); 10 | -------------------------------------------------------------------------------- /src/input/__utils.tsx: -------------------------------------------------------------------------------- 1 | import { Spinner } from "../spinner"; 2 | 3 | import { InputUIProps } from "./InputProps"; 4 | 5 | export const DefaultInputSpinner: InputUIProps["spinner"] = props => { 6 | const { size } = props; 7 | 8 | return ; 9 | }; 10 | -------------------------------------------------------------------------------- /src/progress/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./Progress"; 2 | export * from "./ProgressBar"; 3 | export * from "./ProgressHint"; 4 | export * from "./ProgressLabel"; 5 | export * from "./ProgressProps"; 6 | export * from "./ProgressTrack"; 7 | export * from "./ProgressUIState"; 8 | export * from "./ProgressWrapper"; 9 | -------------------------------------------------------------------------------- /src/select/__utils.tsx: -------------------------------------------------------------------------------- 1 | import { Spinner } from "../spinner"; 2 | 3 | import { SelectUIProps } from "./SelectProps"; 4 | 5 | export const DefaultSelectSpinner: SelectUIProps["spinner"] = props => { 6 | const { size } = props; 7 | 8 | return ; 9 | }; 10 | -------------------------------------------------------------------------------- /src/radio/stories/RadioBasic.component.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | import { Radio, RadioProps } from "../../index"; 4 | 5 | export const RadioBasic: React.FC = props => { 6 | return ; 7 | }; 8 | 9 | export default RadioBasic; 10 | -------------------------------------------------------------------------------- /.storybook/preview-head.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 12 | -------------------------------------------------------------------------------- /src/box/__tests__/Box.test.tsx: -------------------------------------------------------------------------------- 1 | import { render } from "../../utils/testUtils"; 2 | import { Box } from "../Box"; 3 | 4 | describe("Box", () => { 5 | it("should render properly", () => { 6 | const { asFragment } = render(AdaptUI); 7 | 8 | expect(asFragment()).toMatchSnapshot(); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /src/radio/index.tsx: -------------------------------------------------------------------------------- 1 | export * from "./__utils"; 2 | export * from "./Radio"; 3 | export * from "./RadioDescription"; 4 | export * from "./RadioIcon"; 5 | export * from "./RadioInput"; 6 | export * from "./RadioLabel"; 7 | export * from "./RadioProps"; 8 | export * from "./RadioText"; 9 | export * from "./RadioUIState"; 10 | -------------------------------------------------------------------------------- /src/meter/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./Meter"; 2 | export * from "./MeterBar"; 3 | export * from "./MeterBarWrapper"; 4 | export * from "./MeterHint"; 5 | export * from "./MeterLabel"; 6 | export * from "./MeterProps"; 7 | export * from "./MeterTrack"; 8 | export * from "./MeterUIState"; 9 | export * from "./MeterWrapper"; 10 | -------------------------------------------------------------------------------- /src/box/stories/BoxBasic.component.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | import { Box, BoxProps } from "../../index"; 4 | 5 | export type BoxBasicProps = BoxProps & {}; 6 | 7 | export const BoxBasic: React.FC = props => { 8 | return Box; 9 | }; 10 | 11 | export default BoxBasic; 12 | -------------------------------------------------------------------------------- /src/switch/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./__utils"; 2 | export * from "./Switch"; 3 | export * from "./SwitchDescription"; 4 | export * from "./SwitchIcon"; 5 | export * from "./SwitchInput"; 6 | export * from "./SwitchLabel"; 7 | export * from "./SwitchProps"; 8 | export * from "./SwitchText"; 9 | export * from "./SwitchUIState"; 10 | -------------------------------------------------------------------------------- /src/badge/__tests__/Badge.test.tsx: -------------------------------------------------------------------------------- 1 | import { render } from "../../utils/testUtils"; 2 | import { Badge } from "../Badge"; 3 | 4 | describe("Badge", () => { 5 | it("should render properly", () => { 6 | const { asFragment } = render(AdaptUI); 7 | 8 | expect(asFragment()).toMatchSnapshot(); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /src/icons/stories/IconBasic.component.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | import { Icon, IconProps } from "../../index"; 4 | 5 | export type IconBasicProps = IconProps & {}; 6 | 7 | export const IconBasic: React.FC = props => { 8 | return ; 9 | }; 10 | 11 | export default IconBasic; 12 | -------------------------------------------------------------------------------- /src/spinner/__tests__/Spinner.test.tsx: -------------------------------------------------------------------------------- 1 | import { render } from "../../utils/testUtils"; 2 | import { Spinner } from "../Spinner"; 3 | 4 | describe("Spinner", () => { 5 | it("should render properly", () => { 6 | const { asFragment } = render(); 7 | 8 | expect(asFragment()).toMatchSnapshot(); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /src/tag/stories/TagBasic.component.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | import { Tag, TagProps } from "../../index"; 4 | 5 | export type TagBasicProps = TagProps & {}; 6 | 7 | export const TagBasic: React.FC = props => { 8 | return Images; 9 | }; 10 | 11 | export default TagBasic; 12 | -------------------------------------------------------------------------------- /src/textarea/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./__utils"; 2 | export * from "./Textarea"; 3 | export * from "./TextareaBase"; 4 | export * from "./TextareaGhost"; 5 | export * from "./TextareaIcon"; 6 | export * from "./TextareaProps"; 7 | export * from "./TextareaUIState"; 8 | export * from "./TextareaWrapper"; 9 | export * from "./useAutoSize"; 10 | -------------------------------------------------------------------------------- /src/input/stories/InputBasic.component.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | import { Input, InputProps } from "../../index"; 4 | 5 | export type InputBasicProps = InputProps & {}; 6 | 7 | export const InputBasic: React.FC = props => { 8 | return ; 9 | }; 10 | 11 | export default InputBasic; 12 | -------------------------------------------------------------------------------- /src/checkbox/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./__utils"; 2 | export * from "./Checkbox"; 3 | export * from "./CheckboxDescription"; 4 | export * from "./CheckboxIcon"; 5 | export * from "./CheckboxInput"; 6 | export * from "./CheckboxLabel"; 7 | export * from "./CheckboxProps"; 8 | export * from "./CheckboxText"; 9 | export * from "./CheckboxUIState"; 10 | -------------------------------------------------------------------------------- /src/avatar/stories/AvatarBasic.component.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | import { Avatar, AvatarProps } from "../../index"; 4 | 5 | export type AvatarBasicProps = AvatarProps & {}; 6 | 7 | export const AvatarBasic: React.FC = props => { 8 | return ; 9 | }; 10 | 11 | export default AvatarBasic; 12 | -------------------------------------------------------------------------------- /src/badge/stories/BadgeBasic.component.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | import { Badge, BadgeProps } from "../../index"; 4 | 5 | export type BadgeBasicProps = BadgeProps & {}; 6 | 7 | export const BadgeBasic: React.FC = props => { 8 | return Beta; 9 | }; 10 | 11 | export default BadgeBasic; 12 | -------------------------------------------------------------------------------- /src/switch/stories/SwitchBasic.component.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | import { Switch, SwitchProps } from "../../index"; 4 | 5 | export type SwitchBasicProps = SwitchProps & {}; 6 | 7 | export const SwitchBasic: React.FC = props => { 8 | return ; 9 | }; 10 | 11 | export default SwitchBasic; 12 | -------------------------------------------------------------------------------- /src/spinner/stories/SpinnerBasic.component.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | import { Spinner, SpinnerProps } from "../../index"; 4 | 5 | export type SpinnerBasicProps = SpinnerProps & {}; 6 | 7 | export const SpinnerBasic: React.FC = props => { 8 | return ; 9 | }; 10 | 11 | export default SpinnerBasic; 12 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | presets: [require("./preset")], 4 | content: ["./src/**/*", "./adaptui.config.ts", "./.storybook/**/*"], 5 | 6 | theme: { extend: {} }, 7 | 8 | plugins: [ 9 | require("@tailwindcss/forms")({ 10 | strategy: "class", 11 | }), 12 | ], 13 | }; 14 | -------------------------------------------------------------------------------- /tailwind-utils/animationDelay.js: -------------------------------------------------------------------------------- 1 | function animationDelay({ matchUtilities, theme }) { 2 | matchUtilities( 3 | { 4 | "animation-delay": value => { 5 | return { "animation-delay": `${value}` }; 6 | }, 7 | }, 8 | { 9 | values: theme("animationDelay"), 10 | }, 11 | ); 12 | } 13 | 14 | module.exports = animationDelay; 15 | -------------------------------------------------------------------------------- /src/button/stories/ButtonBasic.component.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | import { Button, ButtonProps } from "../../index"; 4 | 5 | export type ButtonBasicProps = ButtonProps & {}; 6 | 7 | export const ButtonBasic: React.FC = props => { 8 | return ; 9 | }; 10 | 11 | export default ButtonBasic; 12 | -------------------------------------------------------------------------------- /src/button/stories/ButtonClose.component.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | import { CloseButton, CloseButtonProps } from "../../index"; 4 | 5 | export type ButtonCloseProps = CloseButtonProps & {}; 6 | 7 | export const ButtonClose: React.FC = props => { 8 | return ; 9 | }; 10 | 11 | export default ButtonClose; 12 | -------------------------------------------------------------------------------- /src/checkbox/stories/CheckboxBasic.component.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | import { Checkbox, CheckboxProps } from "../../index"; 4 | 5 | export type CheckboxBasicProps = CheckboxProps & {}; 6 | 7 | export const CheckboxBasic: React.FC = props => { 8 | return ; 9 | }; 10 | 11 | export default CheckboxBasic; 12 | -------------------------------------------------------------------------------- /src/slider/stories/SliderBasic.component.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | import { Slider, SliderProps } from "../../index"; 4 | 5 | export type SliderBasicProps = SliderProps & {}; 6 | 7 | export const SliderBasic: React.FC = props => { 8 | return ; 9 | }; 10 | 11 | export default SliderBasic; 12 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint", 4 | "esbenp.prettier-vscode", 5 | "vivaxy.vscode-conventional-commits", 6 | "christian-kohler.path-intellisense", 7 | "bradlc.vscode-tailwindcss", 8 | "orta.vscode-jest", 9 | "tlent.jest-snapshot-language-support", 10 | "vespa-dev-works.jestrunit" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /src/circular-progress/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./CircularProgress"; 2 | export * from "./CircularProgressBar"; 3 | export * from "./CircularProgressBarWrapper"; 4 | export * from "./CircularProgressHint"; 5 | export * from "./CircularProgressProps"; 6 | export * from "./CircularProgressTrack"; 7 | export * from "./CircularProgressUIState"; 8 | export * from "./CircularProgressWrapper"; 9 | -------------------------------------------------------------------------------- /tailwind-utils/animationDuration.js: -------------------------------------------------------------------------------- 1 | function animationDuration({ matchUtilities, theme }) { 2 | matchUtilities( 3 | { 4 | "animation-duration": value => { 5 | return { "animation-duration": `${value}` }; 6 | }, 7 | }, 8 | { 9 | values: theme("animationDuration"), 10 | }, 11 | ); 12 | } 13 | 14 | module.exports = animationDuration; 15 | -------------------------------------------------------------------------------- /src/button-group/__utils.tsx: -------------------------------------------------------------------------------- 1 | import { createContext } from "../utils"; 2 | 3 | import { ButtonGroupOptions } from "./ButtonGroup"; 4 | 5 | const [ButtonGroupContextProvider, useButtonGroupContext] = 6 | createContext({ 7 | name: "ButtonGroupContext", 8 | strict: false, 9 | }); 10 | 11 | export { ButtonGroupContextProvider, useButtonGroupContext }; 12 | -------------------------------------------------------------------------------- /src/slider/stories/SliderRange.component.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | import { Slider, SliderProps } from "../../index"; 4 | 5 | export type SliderRangeProps = SliderProps & {}; 6 | 7 | export const SliderRange: React.FC = props => { 8 | return ; 9 | }; 10 | 11 | export default SliderRange; 12 | -------------------------------------------------------------------------------- /src/avatar/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./__utils"; 2 | export * from "./Avatar"; 3 | export * from "./AvatarDefaultStatusIndicators"; 4 | export * from "./AvatarIcon"; 5 | export * from "./AvatarImage"; 6 | export * from "./AvatarInitials"; 7 | export * from "./AvatarProps"; 8 | export * from "./AvatarStatusIndicator"; 9 | export * from "./AvatarUIState"; 10 | export * from "./AvatarWrapper"; 11 | -------------------------------------------------------------------------------- /src/avatar-group/__utils.ts: -------------------------------------------------------------------------------- 1 | import { createContext } from "../utils"; 2 | 3 | import { AvatarGroupUIProps } from "./AvatarGroupProps"; 4 | 5 | const [AvatarGroupContextProvider, useAvatarGroupContext] = 6 | createContext({ 7 | name: "AvatarGroupContextProvider", 8 | strict: false, 9 | }); 10 | 11 | export { AvatarGroupContextProvider, useAvatarGroupContext }; 12 | -------------------------------------------------------------------------------- /src/divider/__tests__/__snapshots__/Divider.test.tsx.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`Divider should render properly 1`] = ` 4 | 5 |
8 | 13 |
14 |
15 | `; 16 | -------------------------------------------------------------------------------- /src/icons/Dash.tsx: -------------------------------------------------------------------------------- 1 | import { createIcon } from "../create-icon"; 2 | 3 | export const DashIcon = createIcon({ 4 | displayName: "DashIcon", 5 | viewBox: "0 0 12 12", 6 | path: ( 7 | 13 | ), 14 | }); 15 | -------------------------------------------------------------------------------- /src/divider/__tests__/Divider.test.tsx: -------------------------------------------------------------------------------- 1 | import { render } from "../../utils/testUtils"; 2 | import { Divider } from "../Divider"; 3 | 4 | describe("Divider", () => { 5 | it("should render properly", () => { 6 | const { asFragment } = render( 7 |
8 | 9 |
, 10 | ); 11 | 12 | expect(asFragment()).toMatchSnapshot(); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /src/checkbox-group/__utils.ts: -------------------------------------------------------------------------------- 1 | import { createContext } from "../utils"; 2 | 3 | import { CheckboxGroupUIProps } from "./CheckboxGroupProps"; 4 | 5 | const [CheckboxGroupContextProvider, useCheckboxGroupContext] = 6 | createContext({ 7 | name: "CheckboxGroupContextProvider", 8 | strict: false, 9 | }); 10 | 11 | export { CheckboxGroupContextProvider, useCheckboxGroupContext }; 12 | -------------------------------------------------------------------------------- /src/meter/stories/MeterBasic.component.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | import { Meter, MeterProps } from "../../index"; 4 | 5 | export type MeterBasicProps = MeterProps & {}; 6 | 7 | export const MeterBasic: React.FC = props => { 8 | return ( 9 |
10 | 11 |
12 | ); 13 | }; 14 | 15 | export default MeterBasic; 16 | -------------------------------------------------------------------------------- /src/textarea/__utils.tsx: -------------------------------------------------------------------------------- 1 | import { Spinner } from "../spinner"; 2 | 3 | import { TextareaUIProps } from "./TextareaProps"; 4 | 5 | export const DefaultTextareaSpinner: TextareaUIProps["spinner"] = props => { 6 | const { size } = props; 7 | 8 | return ( 9 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /preset.d.ts: -------------------------------------------------------------------------------- 1 | import { Config } from "@tailwindcss/config"; 2 | 3 | // Cannot use generic constraints in T because it would then infer the Config and `preset`, 4 | // would not be able to infer `component` keys which would break the typesafe component extends. 5 | // So by doing this we can get both typesafe intellisense in the tailwind config and also the component extends 6 | export function preset(arg: Config & T): T; 7 | -------------------------------------------------------------------------------- /src/textarea/stories/TextareaBasic.component.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | import { Textarea, TextareaProps } from "../../index"; 4 | 5 | export type TextareaBasicProps = TextareaProps & {}; 6 | 7 | export const TextareaBasic: React.FC = props => { 8 | return