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

Prefix support #1498

Draft
wants to merge 181 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
181 commits
Select commit Hold shift + click to select a range
02b6a4d
feat: first prefix support implementation with class list generation …
SutuSebastian Oct 11, 2024
347b8ae
chore: drop `tailwindcss-patch` in favor of manual search and parse c…
SutuSebastian Oct 14, 2024
9617f96
convert `class-list.json` to class-list.ts`
SutuSebastian Oct 14, 2024
05217ac
sort `CLASS_LIST_MAP`
SutuSebastian Oct 14, 2024
a3c4e14
cleanup:
SutuSebastian Oct 15, 2024
7781fbd
fix theme extend values
SutuSebastian Oct 15, 2024
c7ce9e5
fix storybook `darkMode` to be `class`
SutuSebastian Oct 15, 2024
a0766af
remove `flowbite/plugin`
SutuSebastian Oct 15, 2024
9c66a31
extend theme instead of override
SutuSebastian Oct 15, 2024
aaca7fc
format
SutuSebastian Oct 15, 2024
21256d3
expose `helpers` and `hooks` too
SutuSebastian Oct 15, 2024
d4096c6
expose all plugin internals
SutuSebastian Oct 15, 2024
4e675ce
fix "Masquerading as CJS"
SutuSebastian Oct 17, 2024
7ccd2fd
fix circular import warning
SutuSebastian Oct 17, 2024
be7f96f
undo `"type": "commonjs"`; check CI
SutuSebastian Oct 17, 2024
2318dc1
redo `"type": "commonjs"`; check CI
SutuSebastian Oct 17, 2024
4e993ab
up root packages
SutuSebastian Oct 17, 2024
e3702c3
bump oven-sh/setup-bun
SutuSebastian Oct 17, 2024
d23754f
up more packages + fix types
SutuSebastian Oct 17, 2024
d6c916b
import type
SutuSebastian Oct 22, 2024
6890260
up packages
SutuSebastian Oct 22, 2024
297e064
remove unused import
SutuSebastian Oct 22, 2024
c41ea1e
rework theming system and add prefix on-the-fly -- [UNSTABLE]
SutuSebastian Oct 25, 2024
7832e11
enhance `applyPrefix`
SutuSebastian Oct 26, 2024
e08d74a
fix derp reversed if-else
SutuSebastian Oct 26, 2024
f8918c9
simplify `resolveTheme`
SutuSebastian Oct 26, 2024
d739163
remove unused import
SutuSebastian Oct 26, 2024
3c722bf
implement `twMerge` proxy with prefix provided from `getStore()`
SutuSebastian Oct 27, 2024
e23c2e3
up some packages; clean next.config.js
SutuSebastian Oct 28, 2024
678638c
deeply merge `theme` objects (from store or props) using `twMerge`
SutuSebastian Oct 28, 2024
c3bd201
resolve unique values
SutuSebastian Oct 29, 2024
de5450b
resolve `deepMergeStrings` unique values
SutuSebastian Oct 29, 2024
1db1f58
improve VSCode settings
SutuSebastian Dec 13, 2024
2d1f9f3
add postcss types
SutuSebastian Dec 18, 2024
c8098e5
vscode settings - preferTypeOnlyAutoImports
SutuSebastian Dec 18, 2024
4917971
deprecate `<Flowbite>` references in favor of `ThemeProvider`; also f…
SutuSebastian Dec 18, 2024
904f5c5
resolveClassList: always return unique list of class names
SutuSebastian Dec 18, 2024
f7ef07a
apps/storybook:
SutuSebastian Dec 19, 2024
fd17ab1
sort extentions
SutuSebastian Dec 19, 2024
4a307a5
up packages
SutuSebastian Dec 19, 2024
4a4b7ee
up `ui` packages
SutuSebastian Dec 19, 2024
2c28209
fix tests
SutuSebastian Dec 19, 2024
26a0212
apps: add namspace to name - avoid collision with existing npm/jsr pa…
SutuSebastian Dec 19, 2024
297c97b
fix tailwindCSS.experimental.configFile
SutuSebastian Dec 19, 2024
8457ce5
- deprecate `resolveTheme` shouldPrefix
SutuSebastian Dec 20, 2024
dcc3954
rename `pluck` to `get`
SutuSebastian Dec 21, 2024
23adf37
finish `resolveUnstyled`; add more JSDoc
SutuSebastian Dec 21, 2024
81707ec
deprecate exporting `getStore()` and only allow finite actions and ge…
SutuSebastian Dec 23, 2024
89aa30c
use react context for `ThemeProvider`
SutuSebastian Dec 23, 2024
42d755e
enhance ThemeProvider to support deep merging of themes and unstyled …
SutuSebastian Dec 23, 2024
3a2e9da
fix build #1
SutuSebastian Dec 23, 2024
91646cb
fix build; fix client/server non-serializable props in docs examples;…
SutuSebastian Dec 23, 2024
5842e15
add `unstyled` to the rest of the components
SutuSebastian Dec 24, 2024
e68b9bd
rename `unstyled` to `resetTheme`
SutuSebastian Dec 24, 2024
fdcfb8c
fix(datepicker): tests
SutuSebastian Dec 24, 2024
7a88193
remove redundant `Flowbite` prefix from types
SutuSebastian Dec 24, 2024
9921b65
remove redundant `Flowbite` prefix from types #2
SutuSebastian Dec 24, 2024
f4a4719
remove unused types; inline 1x usage types
SutuSebastian Dec 24, 2024
29ddb92
enhance `ThemeProvider` with `applyTheme` prop and `root` prop to con…
SutuSebastian Dec 27, 2024
aff03e9
centralize theming system component props into `ThemingProps`
SutuSebastian Dec 27, 2024
224da17
explicit naming convention
SutuSebastian Dec 27, 2024
1c35c0d
implement `applyTheme` to `resolveTheme()`
SutuSebastian Dec 27, 2024
11d2e53
bypass TS inference
SutuSebastian Dec 27, 2024
3d9565f
fix `resolveTheme` jsdoc
SutuSebastian Dec 27, 2024
d7bfbbc
fix TS errors
SutuSebastian Dec 27, 2024
9f6765b
make `root` prop only for `ThemeProviderProps `
SutuSebastian Dec 27, 2024
caa6821
run stricter lint rules + apply fixes
SutuSebastian Dec 28, 2024
4881c04
format + remove unused imports
SutuSebastian Dec 28, 2024
b03938f
add `get()` test
SutuSebastian Dec 28, 2024
ba54036
apply all args to `resolveTheme` #1
SutuSebastian Dec 28, 2024
e9ab272
apply all args to `resolveTheme` #2
SutuSebastian Dec 28, 2024
f134288
fix docs navbar
SutuSebastian Dec 29, 2024
3d2e215
fix: `eslint.workingDirectories` vscode settings
SutuSebastian Dec 29, 2024
6a3c353
refactor: replace react-icons with custom icon components in UI compo…
SutuSebastian Dec 29, 2024
5842cc9
cleanup
SutuSebastian Dec 29, 2024
f454042
chore: update dependencies and bun version to latest
SutuSebastian Dec 29, 2024
e0cd0b8
fix: update suppressHydrationWarning in RootLayout and correct TypeSc…
SutuSebastian Dec 29, 2024
4bcb8b9
docs: update Flowbite React integration instructions in Tailwind CSS …
SutuSebastian Jan 2, 2025
e774041
fix: disable tailwindcss/no-custom-classname rule in various componen…
SutuSebastian Jan 2, 2025
cf6757e
docs: add documentation for customizing Tailwind CSS prefix
SutuSebastian Jan 2, 2025
4046d19
docs: remove redundant list of Flowbite React components from server …
SutuSebastian Jan 2, 2025
5fd7aa9
docs: add documentation for Flowbite React Tailwind CSS plugin and up…
SutuSebastian Jan 2, 2025
16cf93f
docs: update code block line highlight in Flowbite React Tailwind CSS…
SutuSebastian Jan 2, 2025
c2368ba
test: add unit tests for ThemeProvider component
SutuSebastian Jan 2, 2025
84d9cb3
test: add unit tests for ThemeModeScript component
SutuSebastian Jan 2, 2025
1149b93
fix: reorder List item in typography section of docs sidebar
SutuSebastian Jan 2, 2025
2972e96
fix: rename .test. to .spec.
SutuSebastian Jan 2, 2025
b877faa
style: simplify font family configuration and clean up CSS styles
SutuSebastian Jan 4, 2025
40f0933
chore: deprecate compound components (breaking change)
SutuSebastian Jan 5, 2025
9196dba
fix(docs-examples): update fileName from 'client' to 'index'
SutuSebastian Jan 5, 2025
040c75e
refactor: simplify code structure by changing code array to object
SutuSebastian Jan 5, 2025
0b34df5
refactor: rename resetTheme prop to clearTheme for consistency
SutuSebastian Jan 5, 2025
8895d51
style: update visible table of contents styles for improved spacing a…
SutuSebastian Jan 5, 2025
6975519
feat(types): enhance ThemingProps interface with additional theme man…
SutuSebastian Jan 5, 2025
6bad020
style: remove unnecessary padding from table of contents component
SutuSebastian Jan 5, 2025
6f0fdc3
fix crash
SutuSebastian Jan 6, 2025
16c1afb
refactor: remove unused "use client" directives and simplify ButtonGr…
SutuSebastian Jan 6, 2025
0efa366
refactor: replace rimraf with native shell command for output directo…
SutuSebastian Jan 6, 2025
816e441
refactor(ButtonGroup): update class expectations to use grouped class…
SutuSebastian Jan 6, 2025
c6b9dd3
chore: update @types/bun and @types/web to latest versions
SutuSebastian Jan 7, 2025
22bf607
refactor: convert functional components to named function syntax for …
SutuSebastian Jan 8, 2025
9b2cdbd
refactor: update import statements to use type imports for consistency
SutuSebastian Jan 8, 2025
2549801
refactor(theme): export useThemeProvider and additional types from pr…
SutuSebastian Jan 8, 2025
dc9cb6e
refactor(resolve-theme): remove caching mechanism for theme resolution
SutuSebastian Jan 8, 2025
f7ab913
refactor(resolve-theme): remove caching test for theme resolution
SutuSebastian Jan 8, 2025
beca7a8
refactor: create `useResolveTheme` with useMemo wrapper to `resolveTh…
SutuSebastian Jan 8, 2025
4bc4fca
fix(resolveTheme): stable memoization; deep merging granularity
SutuSebastian Jan 9, 2025
7a10f8c
refactor(resolve-theme): optimize theme application logic to prevent …
SutuSebastian Jan 9, 2025
f668c69
refactor(get): improve handling of empty and invalid paths; enhance d…
SutuSebastian Jan 10, 2025
9248255
chore: update dependencies and bun version across
SutuSebastian Jan 10, 2025
9432532
export theme from each component
SutuSebastian Jan 10, 2025
b8cfa11
refactor(Textarea): update storybook default value and placeholder; f…
SutuSebastian Jan 10, 2025
095e2c2
refactor(TextInput): update storybook placeholder; fix theme styles
SutuSebastian Jan 10, 2025
0d8c822
refactor(FileInput): fix theme styles + simplify component JSX
SutuSebastian Jan 11, 2025
3f32f87
refactor(FileInput): drop `helperText` prop and inline it in docs
SutuSebastian Jan 11, 2025
24b5bbf
refactor(Checkbox): fix theme styles and add indeterminate state support
SutuSebastian Jan 12, 2025
5b7d5af
fix: typecheck
SutuSebastian Jan 12, 2025
6de15ca
refactor(Radio): fix theme styles and add color support
SutuSebastian Jan 12, 2025
44b957c
refactor(ToggleSwitch): fix theme styles
SutuSebastian Jan 13, 2025
fed0c53
fix test
SutuSebastian Jan 13, 2025
870ea3e
refactor(Select): fix theme styles
SutuSebastian Jan 13, 2025
b7dc8b1
refactor(RangeSlider): simplify JSX structure
SutuSebastian Jan 13, 2025
90605e0
refactor(Button): add colors `default`, `alternative`
SutuSebastian Jan 13, 2025
ead62c5
refactor(Button): update title for clarity
SutuSebastian Jan 13, 2025
afe3016
refactor(Navbar): update link active styles to use primary instead of…
SutuSebastian Jan 13, 2025
aee2985
refactor(Progress): update default color to primary and remove color …
SutuSebastian Jan 13, 2025
23138b3
refactor(Spinner): update default color to 'default', adjust size to …
SutuSebastian Jan 13, 2025
a1c1d8a
refactor(Tabs): update tab item colors to use primary instead of cyan
SutuSebastian Jan 13, 2025
ab95546
refactor(Timeline): update icon colors to use primary instead of cyan
SutuSebastian Jan 13, 2025
abedd68
apps(web): use primary instead of cyan
SutuSebastian Jan 13, 2025
be318b3
refactor(Button): update alternative button hover color to use primar…
SutuSebastian Jan 13, 2025
d0e49b9
refactor(Button): move `theme.size` from inner span to root button
SutuSebastian Jan 14, 2025
bc2354a
refactor(List): remove unused ListColors interface
SutuSebastian Jan 14, 2025
8532392
refactor(MainFooter): update link colors to use primary-700 for bette…
SutuSebastian Jan 14, 2025
c9adcb9
refactor(Button): rework theme and cleanup button logic to act more l…
SutuSebastian Jan 14, 2025
a476894
refactor(ToggleSwitch): fix theme
SutuSebastian Jan 15, 2025
42e6638
refactor(package.json): add icons entry for module resolution
SutuSebastian Jan 15, 2025
685f868
chore(ui): export all contexts
SutuSebastian Jan 15, 2025
ab2276e
refactor(docs.css): adjust margin for first child in main content
SutuSebastian Jan 17, 2025
2ccea8d
refactor(tailwind.config): remove unused fade-in keyframes and animation
SutuSebastian Jan 17, 2025
3892245
refactor(FloatingLabel): update focus border colors to use primary theme
SutuSebastian Jan 17, 2025
4a74eb8
refactor(docs): replace isNew flag with tag for sidebar items; deprec…
SutuSebastian Jan 17, 2025
781336d
refactor(ui): add `forwardRef` to almost all components
SutuSebastian Jan 17, 2025
62297ed
refactor(Badge): deprecate `href`
SutuSebastian Jan 17, 2025
8636c2d
refactor(FloatingLabel.stories): remove unused HelperText story
SutuSebastian Jan 17, 2025
919c675
refactor(Badge.spec): fix tests
SutuSebastian Jan 17, 2025
696ea93
fix: naming convention
SutuSebastian Jan 18, 2025
0e3379a
refactor(docs.css): enhance code styling with border adjustments
SutuSebastian Jan 18, 2025
167b371
refactor(vscode): update tailwindCSS classRegex for theme initialization
SutuSebastian Jan 18, 2025
5bbb2c1
refactor: update theme creation to use generic types for better type …
SutuSebastian Jan 18, 2025
3941193
refactor(vscode): simplify tailwindCSS classRegex for theme functions
SutuSebastian Jan 18, 2025
edd4514
refactor: set default generic type for createTheme function
SutuSebastian Jan 18, 2025
d70c2a0
refactor(ui): split icons into separate files to allow tree-shaking
SutuSebastian Jan 18, 2025
ab7d0b0
refactor(tests): remove redundant import of act from react-dom/test-u…
SutuSebastian Jan 18, 2025
8911d53
refactor(rollup): remove react-icons from external dependencies
SutuSebastian Jan 20, 2025
30e53e7
refactor(helpers): remove redundant folder
SutuSebastian Jan 20, 2025
9e59863
refactor(rollup): include icons directory in entry points
SutuSebastian Jan 20, 2025
a334c71
refactor(tests): update ButtonGroup tests to use buttonTheme for grou…
SutuSebastian Jan 21, 2025
e978585
refactor(components): update imports in Avatar, BannerCollapseButton,…
SutuSebastian Jan 21, 2025
04db682
refactor(theme): remove `theme` export since its now redundant
SutuSebastian Jan 21, 2025
bb0c71e
refactor(tests): update Popover and Tooltip imports to use specific f…
SutuSebastian Jan 21, 2025
b1af707
refactor(stories): update imports to use specific theme files for Ale…
SutuSebastian Jan 21, 2025
dbfcd87
refactor(theme): update to-be-deprecated tailwindCSS classes
SutuSebastian Jan 21, 2025
388f5f5
refactor(package): add icon paths to package.json and include theme e…
SutuSebastian Jan 21, 2025
065672d
refactor(package): add theme entry points for ESM and CJS in package.…
SutuSebastian Jan 21, 2025
58f1730
refactor(components): update imports to use centralized types from ..…
SutuSebastian Jan 21, 2025
d158b9b
refactor(ThemeProvider): implement default `props` blueprints
SutuSebastian Jan 21, 2025
30bbc93
refactor(theming): add withoutThemingProps utility and update Flowbit…
SutuSebastian Jan 21, 2025
dab8c0f
refactor(helpers): add tests and improve documentation for utility fu…
SutuSebastian Jan 21, 2025
34765ea
refactor(components): integrate resolveProps (partial, not for all)
SutuSebastian Jan 21, 2025
b704e37
refactor(stories): update Label component usage in Modal stories
SutuSebastian Jan 21, 2025
9909591
refactor(forms): update Label component usage to remove deprecated va…
SutuSebastian Jan 21, 2025
a34b648
refactor(components): integrate resolveProps (partial, not for all);
SutuSebastian Jan 22, 2025
e0fa397
refactor(components): integrate resolveProps - FINAL
SutuSebastian Jan 22, 2025
0801591
refactor(helpers): remove omit function and its tests
SutuSebastian Jan 22, 2025
a63321c
fix(Card): fix img tag render
SutuSebastian Jan 22, 2025
33598ad
test(Table): remove redundant row count expectation
SutuSebastian Jan 22, 2025
a295b9d
feat(theme): replace structuredClone with klona for performance impro…
SutuSebastian Jan 22, 2025
80e6565
feat(theme): more performance improvements
SutuSebastian Jan 22, 2025
ec5d379
fix(theme): add optional chaining for custom theme checks
SutuSebastian Jan 22, 2025
67305c0
feat(theme): more performance improvements
SutuSebastian Jan 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["storybook", "web"]
"ignore": ["@/storybook", "@/web"]
}
4 changes: 2 additions & 2 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ runs:
using: composite
steps:
- name: Setup Bun
uses: oven-sh/setup-bun@v1
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.1.21
bun-version: 1.1.43

- name: Setup Node
uses: actions/setup-node@v4
Expand Down
10 changes: 5 additions & 5 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"recommendations": [
"oven.bun-vscode",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"yoavbls.pretty-ts-errors",
"bradlc.vscode-tailwindcss",
"DavidAnson.vscode-markdownlint",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"oven.bun-vscode",
"unifiedjs.vscode-mdx",
"DavidAnson.vscode-markdownlint"
"yoavbls.pretty-ts-errors"
]
}
12 changes: 10 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,23 @@
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"eslint.workingDirectories": ["apps/web", "packages/ui"],
"editor.quickSuggestions": {
"strings": "on"
},
"eslint.workingDirectories": [{ "mode": "auto" }],
"files.associations": {
"*.css": "tailwindcss"
},
"tailwindCSS.classAttributes": ["class", "className", "theme"],
"tailwindCSS.experimental.classRegex": [
["twMerge\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["createTheme\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]
["createTheme(?:<\\w+>)?\\s*\\(([^)]*)\\)", "{?\\s?[\\w].*:\\s*?[\"'`]([^\"'`]*).*?,?\\s?}?"]
],
"tailwindCSS.experimental.configFile": {
"apps/storybook/tailwind.config.cjs": "apps/storybook/**",
"apps/web/tailwind.config.cjs": "apps/web/**",
"packages/ui/tailwind.config.cjs": "packages/ui/**"
},
"typescript.preferences.preferTypeOnlyAutoImports": true,
"typescript.tsdk": "node_modules/typescript/lib"
}
44 changes: 44 additions & 0 deletions apps/storybook/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
env: {
browser: true,
commonjs: true,
es2021: true,
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:tailwindcss/recommended",
"prettier",
],
overrides: [
{
files: ["**/*.{ts,tsx}"],
plugins: ["@typescript-eslint"],
parser: "@typescript-eslint/parser",
extends: ["plugin:@typescript-eslint/recommended"],
},
],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["react-refresh"],
settings: {
react: {
version: "detect",
},
tailwindcss: {
callees: ["twMerge", "createTheme"],
classRegex: "^(class(Name)|theme)?$",
},
},
ignorePatterns: ["storybook-static"],
rules: {
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
"react/no-unescaped-entities": "off",
"react/prop-types": "off",
},
};
2 changes: 1 addition & 1 deletion apps/storybook/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function getAbsolutePath(value: string): any {
return dirname(require.resolve(join(value, "package.json")));
}
const config: StorybookConfig = {
stories: ["../../../packages/ui/**/*.stories.@(ts|tsx)"],
stories: ["../src/**/*.stories.{ts,tsx}"],
addons: [
getAbsolutePath("@storybook/addon-links"),
getAbsolutePath("@storybook/addon-essentials"),
Expand Down
24 changes: 17 additions & 7 deletions apps/storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "storybook",
"name": "@/storybook",
"version": "0.0.0",
"private": true,
"scripts": {
Expand All @@ -8,11 +8,15 @@
"dev": "storybook dev -p 6006",
"format": "prettier . --write",
"format:check": "prettier . --check",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"flowbite-react": "workspace:*",
"react": "18.3.1",
"react-dom": "18.3.1"
"react-dom": "18.3.1",
"react-icons": "5.2.1"
},
"devDependencies": {
"@storybook/addon-essentials": "8.1.10",
Expand All @@ -25,12 +29,18 @@
"@storybook/test": "8.1.10",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@vitejs/plugin-react": "4.3.1",
"@typescript-eslint/eslint-plugin": "8.19.1",
"@typescript-eslint/parser": "8.19.1",
"@vitejs/plugin-react": "4.3.4",
"autoprefixer": "10.4.20",
"postcss": "8.4.41",
"eslint-plugin-react": "7.37.3",
"eslint-plugin-react-refresh": "0.4.16",
"eslint-plugin-storybook": "0.11.1",
"eslint-plugin-vitest": "0.5.4",
"postcss": "8.4.49",
"storybook": "8.1.10",
"tailwindcss": "3.4.7",
"typescript": "5.5.4",
"vite": "5.3.5"
"tailwindcss": "3.4.17",
"typescript": "5.6.3",
"vite": "6.0.7"
}
}
1 change: 1 addition & 0 deletions apps/storybook/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @type {import('postcss-load-config').Config} */
module.exports = {
plugins: {
tailwindcss: {},
Expand Down
10 changes: 10 additions & 0 deletions apps/storybook/prettier.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const rootPrettier = require("../../prettier.config.cjs");

/** @type {import('prettier').Config} */
module.exports = {
...rootPrettier,
plugins: [...rootPrettier.plugins, "prettier-plugin-tailwindcss"],
// tailwindcss
tailwindAttributes: ["theme"],
tailwindFunctions: ["twMerge", "createTheme"],
};
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { Meta, StoryFn } from "@storybook/react";
import type { ComponentProps, FC } from "react";
import { Accordion, AccordionContent, AccordionPanel, AccordionTitle, type AccordionProps } from "flowbite-react";
import { HiChevronDown, HiOutlineArrowCircleDown } from "react-icons/hi";
import type { AccordionProps } from "./Accordion";
import { Accordion } from "./Accordion";

export default {
title: "Components/Accordion",
Expand All @@ -13,13 +11,11 @@ export default {
},
} as Meta;

const icon: FC<ComponentProps<"svg">> = HiChevronDown;

const Template: StoryFn<AccordionProps> = (args) => (
<Accordion arrowIcon={icon} {...args}>
<Accordion.Panel>
<Accordion.Title>What is Flowbite?</Accordion.Title>
<Accordion.Content>
<Accordion arrowIcon={HiChevronDown} {...args}>
<AccordionPanel>
<AccordionTitle>What is Flowbite?</AccordionTitle>
<AccordionContent>
<p className="mb-2 text-gray-500 dark:text-gray-400">
Flowbite is an open-source library of interactive components built on top of Tailwind CSS including buttons,
dropdowns, modals, navbars, and more.
Expand All @@ -34,11 +30,11 @@ const Template: StoryFn<AccordionProps> = (args) => (
</a>
&nbsp;and start developing websites even faster with components on top of Tailwind CSS.
</p>
</Accordion.Content>
</Accordion.Panel>
<Accordion.Panel>
<Accordion.Title>Is there a Figma file available?</Accordion.Title>
<Accordion.Content>
</AccordionContent>
</AccordionPanel>
<AccordionPanel>
<AccordionTitle>Is there a Figma file available?</AccordionTitle>
<AccordionContent>
<p className="mb-2 text-gray-500 dark:text-gray-400">
Flowbite is first conceptualized and designed using the Figma software so everything you see in the library
has a design equivalent in our Figma file.
Expand All @@ -50,11 +46,11 @@ const Template: StoryFn<AccordionProps> = (args) => (
</a>
&nbsp;based on the utility classes from Tailwind CSS and components from Flowbite.
</p>
</Accordion.Content>
</Accordion.Panel>
<Accordion.Panel>
<Accordion.Title>What are the differences between Flowbite and Tailwind UI?</Accordion.Title>
<Accordion.Content>
</AccordionContent>
</AccordionPanel>
<AccordionPanel>
<AccordionTitle>What are the differences between Flowbite and Tailwind UI?</AccordionTitle>
<AccordionContent>
<p className="mb-2 text-gray-500 dark:text-gray-400">
The main difference is that the core components from Flowbite are open source under the MIT license, whereas
Tailwind UI is a paid product. Another difference is that Flowbite relies on smaller and standalone
Expand All @@ -81,8 +77,8 @@ const Template: StoryFn<AccordionProps> = (args) => (
</a>
</li>
</ul>
</Accordion.Content>
</Accordion.Panel>
</AccordionContent>
</AccordionPanel>
</Accordion>
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import type { Meta, StoryFn } from "@storybook/react";
import type { AlertProps } from "flowbite-react";
import { Alert, alertTheme } from "flowbite-react";
import { HiEye, HiInformationCircle } from "react-icons/hi";
import { theme } from "../../theme";
import type { AlertProps } from "./Alert";
import { Alert } from "./Alert";

export default {
title: "Components/Alert",
component: Alert,
argTypes: {
color: {
options: Object.keys(theme.alert.color),
options: Object.keys(alertTheme.color),
control: { type: "inline-radio" },
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryFn } from "@storybook/react";
import type { AvatarProps } from "./Avatar";
import { Avatar } from "./Avatar";
import type { AvatarProps } from "flowbite-react";
import { Avatar } from "flowbite-react";

export default {
title: "Components/Avatar",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import type { Meta, StoryFn } from "@storybook/react";
import { Avatar } from "./Avatar";
import type { AvatarGroupProps } from "./AvatarGroup";
import type { AvatarGroupProps } from "flowbite-react";
import { Avatar, AvatarGroup, AvatarGroupCounter } from "flowbite-react";

export default {
title: "Components/Avatar",
component: Avatar.Group,
component: AvatarGroup,
} as Meta;

const Template: StoryFn<AvatarGroupProps> = (args) => (
<Avatar.Group {...args}>
<AvatarGroup {...args}>
<Avatar img="https://flowbite.com/docs/images/people/profile-picture-1.jpg" rounded stacked />
<Avatar img="https://flowbite.com/docs/images/people/profile-picture-2.jpg" rounded stacked />
<Avatar img="https://flowbite.com/docs/images/people/profile-picture-3.jpg" rounded stacked />
<Avatar img="https://flowbite.com/docs/images/people/profile-picture-4.jpg" rounded stacked />
<Avatar.Counter total={99} href="#" />
</Avatar.Group>
<AvatarGroupCounter total={99} href="#" />
</AvatarGroup>
);

export const DefaultAvatarGroup = Template.bind({});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import type { Meta, StoryFn } from "@storybook/react";
import type { BadgeProps } from "flowbite-react";
import { Badge, badgeTheme } from "flowbite-react";
import { HiCheck } from "react-icons/hi";
import { theme } from "../../theme";
import type { BadgeProps } from "./Badge";
import { Badge } from "./Badge";

export default {
title: "Components/Badge",
component: Badge,
argTypes: {
color: {
options: Object.keys(theme.badge.root.color),
options: Object.keys(badgeTheme.root.color),
control: { type: "inline-radio" },
},
size: {
options: Object.keys(theme.badge.root.size),
options: Object.keys(badgeTheme.root.size),
control: { type: "inline-radio" },
},
},
Expand Down Expand Up @@ -45,10 +44,3 @@ BadgeOnlyIcon.args = {
color: "green",
icon: HiCheck,
};

export const BadgeAsLink = Template.bind({});
BadgeAsLink.storyName = "As link";
BadgeAsLink.args = {
href: "/badges",
children: "Read more →",
};
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import type { Meta, StoryFn } from "@storybook/react";
import type { BannerProps } from "flowbite-react";
import { Banner, BannerCollapseButton } from "flowbite-react";
import { HiX } from "react-icons/hi";
import { MdAnnouncement } from "react-icons/md";
import type { BannerComponentProps } from "./Banner";
import { Banner } from "./Banner";

export default {
title: "Components/Banner",
component: Banner,
} as Meta;

const Template: StoryFn<BannerComponentProps> = (args) => <Banner {...args} />;
const Template: StoryFn<BannerProps> = (args) => <Banner {...args} />;

export const DefaultBanner = Template.bind({});
DefaultBanner.storyName = "Default";
Expand All @@ -30,9 +30,9 @@ DefaultBanner.args = {
</span>
</p>
</div>
<Banner.CollapseButton color="gray" className="border-0 bg-transparent px-0">
<BannerCollapseButton color="gray" className="border-0 bg-transparent px-0">
<HiX className="size-4" />
</Banner.CollapseButton>
</BannerCollapseButton>
</div>
),
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryFn } from "@storybook/react";
import type { BlockquoteProps } from "./Blockquote";
import { Blockquote } from "./Blockquote";
import type { BlockquoteProps } from "flowbite-react";
import { Blockquote } from "flowbite-react";

export default {
title: "Components/Blockquote",
Expand Down
Loading
Loading