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

docs: component namespacing #8315

Draft
wants to merge 52 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
b1a0077
docs: accordion
Omikorin Feb 25, 2024
51ad75a
chore: alert
Omikorin Feb 25, 2024
a556f4c
fix: props name
Omikorin Feb 25, 2024
9e1f5fe
docs: clean migration
Omikorin Feb 25, 2024
81e52c2
docs: remove alert dialog
Omikorin Feb 25, 2024
9dd053a
fix: accordion
Omikorin Feb 25, 2024
b7073f0
docs: better info about removed
Omikorin Feb 25, 2024
ef0aba9
chore: not sure but container part is root now
Omikorin Feb 25, 2024
2d3c7c1
docs: alert
Omikorin Feb 25, 2024
f99fdc8
docs: avatar
Omikorin Feb 25, 2024
9d1ed38
docs: breadcrumb
Omikorin Feb 25, 2024
78f6f3c
fix: typedocs
Omikorin Feb 25, 2024
72941e6
fix: clean typedocs tests
Omikorin Feb 25, 2024
f49206c
docs: typedocs
Omikorin Feb 25, 2024
32bbe17
docs: fix
Omikorin Feb 25, 2024
90be8f2
docs: card
Omikorin Feb 25, 2024
af55bf0
docs: sort migration
Omikorin Feb 25, 2024
1c9da74
docs: card
Omikorin Feb 25, 2024
535a306
docs: breadcrumb
Omikorin Feb 25, 2024
9885745
docs: button
Omikorin Feb 25, 2024
c2515f6
docs: center
Omikorin Feb 25, 2024
7427e70
docs: checkbox
Omikorin Feb 25, 2024
bb60968
docs: circular progress
Omikorin Feb 25, 2024
eeb8cec
docs: cricular
Omikorin Feb 25, 2024
93bd877
docs: drawer
Omikorin Feb 25, 2024
ca80240
docs: button fixes
Omikorin Feb 25, 2024
8e3e70c
docs: editable
Omikorin Feb 25, 2024
5c178f4
docs: form control to field
Omikorin Feb 25, 2024
803dfa9
docs: field
Omikorin Feb 25, 2024
2e9853b
docs: icon
Omikorin Feb 25, 2024
df51f9e
docs: list
Omikorin Feb 25, 2024
e5cdf70
docs: menu
Omikorin Feb 25, 2024
ad257db
docs: modal to dialog
Omikorin Feb 26, 2024
c4c1d74
docs: fix dialog props
Omikorin Feb 26, 2024
a825c6c
docs: number input
Omikorin Feb 26, 2024
ea1df23
docs: pin input
Omikorin Feb 26, 2024
02eada3
docs: popover
Omikorin Feb 26, 2024
f4de9c3
docs: progress
Omikorin Feb 26, 2024
ba3d05a
fix: dialog anatomy
Omikorin Feb 26, 2024
87a8990
fix: modal to dialog theme
Omikorin Feb 26, 2024
19b10ec
docs: container -> root
Omikorin Feb 26, 2024
0a69bd3
docs: icon
Omikorin Feb 26, 2024
0d86e05
Merge branch 'main' into docs/component-namespacing
Omikorin Mar 21, 2024
6650d08
chore: radio
Omikorin Mar 21, 2024
3a03650
chore: modal -> dialog
Omikorin Mar 21, 2024
7144322
chore: radio -> radio group and fix
Omikorin Mar 21, 2024
5eaaa84
chore: missing radio migration
Omikorin Mar 21, 2024
8ad96c8
chore: select => native select
Omikorin Mar 21, 2024
efd19e0
chore: native select
Omikorin Mar 22, 2024
35bf3e3
chore: stat
Omikorin Mar 22, 2024
034d485
chore: stepper
Omikorin Mar 22, 2024
f5249b2
chore: switch
Omikorin Mar 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
421 changes: 285 additions & 136 deletions MIGRATION.md

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions packages/anatomy/src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export const menuAnatomy = anatomy("menu").parts(
"divider",
)

// TODO: remove this in favor of dialogAnatomy
export const modalAnatomy = anatomy("modal").parts(
"overlay",
"positioner",
Expand All @@ -90,6 +91,16 @@ export const modalAnatomy = anatomy("modal").parts(
"footer",
)

export const dialogAnatomy = anatomy("dialog").parts(
"overlay",
"positioner",
"content",
"header",
"closeTrigger",
"body",
"footer",
)

export const drawerAnatomy = anatomy("drawer").parts(
"overlay",
"positioner",
Expand Down
90 changes: 45 additions & 45 deletions packages/props-docs/generated/accordion.json
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
{
"Accordion": {
"allowMultiple": {
"AccordionTrigger": {},
"AccordionIcon": { "orientation": { "type": "any", "required": false } },
"AccordionItem": {
"id": {
"type": "string",
"required": false,
"description": "A unique id for the accordion item."
},
"isDisabled": {
"type": "boolean",
"defaultValue": false,
"required": false,
"description": "If `true`, multiple accordion items can be expanded at once."
"description": "If `true`, the accordion item will be disabled."
},
"allowToggle": {
"isFocusable": {
"type": "boolean",
"defaultValue": false,
"required": false,
"description": "If `true`, the accordion item will be focusable."
}
},
"AccordionContent": {
"motionProps": {
"type": "CollapseProps",
"required": false,
"description": "The properties passed to the underlying `Collapse` component."
}
},
"AccordionRoot": {
"collapsible": {
"type": "boolean",
"defaultValue": false,
"required": false,
"description": "If `true`, any expanded accordion item can be collapsed again."
},
"defaultIndex": {
"type": "ExpandedIndex",
"type": "number | number[]",
"required": false,
"description": "The initial index(es) of the expanded accordion item"
},
"index": {
"type": "ExpandedIndex",
"type": "number | number[]",
"required": false,
"description": "The index(es) of the expanded accordion item"
},
"onChange": {
"type": "(expandedIndex: ExpandedIndex) => void",
"required": false,
"description": "The callback invoked when accordion items are expanded or collapsed."
},
"reduceMotion": {
"multiple": {
"type": "boolean",
"defaultValue": false,
"required": false,
"description": "If `true`, height animation and transitions will be disabled."
}
},
"AccordionButton": {},
"AccordionIcon": { "orientation": { "type": "any", "required": false } },
"AccordionItem": {
"id": {
"type": "string",
"required": false,
"description": "A unique id for the accordion item."
"description": "If `true`, multiple accordion items can be expanded at once."
},
"isDisabled": {
"type": "boolean",
"defaultValue": false,
"onChange": {
"type": "(expandedIndex: number | number[]) => void",
"required": false,
"description": "If `true`, the accordion item will be disabled."
"description": "The callback invoked when accordion items are expanded or collapsed."
},
"isFocusable": {
"reduceMotion": {
"type": "boolean",
"defaultValue": false,
"required": false,
"description": "If `true`, the accordion item will be focusable."
}
},
"AccordionPanel": {
"motionProps": {
"type": "CollapseProps",
"required": false,
"description": "The properties passed to the underlying `Collapse` component."
"description": "If `true`, height animation and transitions will be disabled."
}
},
"UseAccordionItem": {
Expand All @@ -82,30 +82,30 @@
}
},
"UseAccordion": {
"allowMultiple": {
"type": "boolean",
"defaultValue": false,
"required": false,
"description": "If `true`, multiple accordion items can be expanded at once."
},
"allowToggle": {
"collapsible": {
"type": "boolean",
"defaultValue": false,
"required": false,
"description": "If `true`, any expanded accordion item can be collapsed again."
},
"defaultIndex": {
"type": "ExpandedIndex",
"type": "number | number[]",
"required": false,
"description": "The initial index(es) of the expanded accordion item"
},
"index": {
"type": "ExpandedIndex",
"type": "number | number[]",
"required": false,
"description": "The index(es) of the expanded accordion item"
},
"multiple": {
"type": "boolean",
"defaultValue": false,
"required": false,
"description": "If `true`, multiple accordion items can be expanded at once."
},
"onChange": {
"type": "(expandedIndex: ExpandedIndex) => void",
"type": "(expandedIndex: number | number[]) => void",
"required": false,
"description": "The callback invoked when accordion items are expanded or collapsed."
}
Expand Down
23 changes: 3 additions & 20 deletions packages/props-docs/generated/alert.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,14 @@
{
"Alert": {
"AlertDescription": {},
"AlertIcon": {},
"AlertRoot": {
"addRole": { "type": "boolean", "defaultValue": false, "required": false },
"colorScheme": {
"defaultValue": "blue",
"type": "\"whiteAlpha\" | \"blackAlpha\" | \"gray\" | \"red\" | \"orange\" | \"yellow\" | \"green\" | \"teal\" | \"blue\" | \"cyan\" | \"purple\" | \"pink\"",
"required": false,
"description": "The visual color appearance of the component"
},
"size": {
"type": "string",
"required": false,
"description": "The size of the Alert"
},
"status": {
"type": "\"info\" | \"warning\" | \"success\" | \"error\" | \"loading\"",
"defaultValue": "info",
"required": false,
"description": "The status of the alert"
},
"variant": {
"defaultValue": "subtle",
"type": "\"subtle\" | \"left-accent\" | \"top-accent\" | \"solid\"",
"required": false,
"description": "The variant of the Alert"
}
},
"AlertDescription": {},
"AlertIcon": {},
"AlertTitle": {}
}
124 changes: 92 additions & 32 deletions packages/props-docs/generated/avatar.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,97 @@
{
"Avatar": {
"colorScheme": {
"type": "\"whiteAlpha\" | \"blackAlpha\" | \"gray\" | \"red\" | \"orange\" | \"yellow\" | \"green\" | \"teal\" | \"blue\" | \"cyan\" | \"purple\" | \"pink\"",
"AvatarBadge": {
"placement": { "type": "BadgePlacement", "required": false }
},
"AvatarFallback": {},
"AvatarGroup": {
"max": {
"type": "number",
"required": false,
"description": "The maximum number of visible avatars"
},
"spacing": {
"type": "ResponsiveValue<string | number | (string & {})>",
"defaultValue": "-0.75rem",
"required": false,
"description": "The space between the avatars in the group."
}
},
"AvatarImage": {
"align": {
"type": "ResponsiveValue<ObjectPosition<Length>>",
"required": false,
"description": "The visual color appearance of the component"
"description": "How to align the image within its bounds.\nIt maps to css `object-position` property."
},
"crossOrigin": {
"type": "\"\" | \"anonymous\" | \"use-credentials\"",
"required": false,
"description": "The key used to set the crossOrigin on the HTMLImageElement into which the image will be loaded.\nThis tells the browser to request cross-origin access when trying to download the image data."
},
"fallback": {
"type": "ReactElement<any, string | JSXElementConstructor<any>>",
"required": false,
"description": "Fallback element to show if image is loading or image fails."
},
"fallbackSrc": {
"type": "string",
"required": false,
"description": "Fallback image `src` to show if image is loading or image fails.\n\nNote 🚨: We recommend you use a local image"
},
"fallbackStrategy": {
"type": "FallbackStrategy",
"defaultValue": "beforeLoadOrError",
"required": false,
"description": "- beforeLoadOrError(default): loads the fallbackImage while loading the src\n- onError: loads the fallbackImage only if there is an error fetching the src"
},
"fit": {
"type": "ResponsiveValue<ObjectFit>",
"required": false,
"description": "How the image to fit within its bounds.\nIt maps to css `object-fit` property."
},
"htmlHeight": {
"type": "string | number",
"required": false,
"description": "The native HTML `height` attribute to the passed to the `img`"
},
"htmlWidth": {
"type": "string | number",
"required": false,
"description": "The native HTML `width` attribute to the passed to the `img`"
},
"ignoreFallback": {
"type": "boolean",
"defaultValue": false,
"required": false,
"description": "If `true`, opt out of the `fallbackSrc` logic and use as `img`"
},
"loading": { "type": "\"eager\" | \"lazy\"", "required": false },
"onError": {
"type": "ReactEventHandler<HTMLImageElement>",
"required": false,
"description": "A callback for when there was an error loading the image `src`"
},
"onLoad": {
"type": "ReactEventHandler<HTMLImageElement>",
"required": false,
"description": "A callback for when the image `src` has been loaded"
},
"sizes": {
"type": "string",
"required": false,
"description": "The image `sizes` attribute"
},
"src": {
"type": "string",
"required": false,
"description": "The image `src` attribute"
},
"srcSet": {
"type": "string",
"required": false,
"description": "The image `srcset` attribute"
}
},
"AvatarRoot": {
"crossOrigin": {
"type": "\"\" | \"anonymous\" | \"use-credentials\"",
"required": false
Expand Down Expand Up @@ -37,7 +124,7 @@
"description": "The name of the person in the avatar.\n\n- if `src` has loaded, the name will be used as the `alt` attribute of the `img`\n- If `src` is not loaded, the name will be used to create the initials"
},
"onError": {
"type": "() => void",
"type": "VoidFunction",
"required": false,
"description": "Function called when image failed to load"
},
Expand All @@ -52,12 +139,6 @@
"required": false,
"description": "If `true`, the `Avatar` will show a border around it.\n\nBest for a group of avatars"
},
"size": {
"defaultValue": "md",
"type": "\"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\" | \"full\"",
"required": false,
"description": "The size of the Avatar"
},
"src": {
"type": "string",
"required": false,
Expand All @@ -67,27 +148,6 @@
"type": "string",
"required": false,
"description": "List of sources to use for different screen resolutions"
},
"variant": {
"type": "string",
"required": false,
"description": "The variant of the Avatar"
}
},
"AvatarBadge": {
"placement": { "type": "BadgePlacement", "required": false }
},
"AvatarGroup": {
"max": {
"type": "number",
"required": false,
"description": "The maximum number of visible avatars"
},
"spacing": {
"type": "ResponsiveValue<string | number | (string & {})>",
"defaultValue": "-0.75rem",
"required": false,
"description": "The space between the avatars in the group."
}
}
}
2 changes: 1 addition & 1 deletion packages/props-docs/generated/badge.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Badge": {
"colorScheme": {
"defaultValue": "gray",
"type": "\"whiteAlpha\" | \"blackAlpha\" | \"gray\" | \"red\" | \"orange\" | \"yellow\" | \"green\" | \"teal\" | \"blue\" | \"cyan\" | \"purple\" | \"pink\"",
"type": "\"whiteAlpha\" | \"blackAlpha\" | \"gray\" | \"red\" | \"orange\" | \"yellow\" | \"green\" | \"teal\" | \"blue\" | \"cyan\" | \"purple\" | \"pink\" | \"linkedin\" | \"facebook\" | \"messenger\" | \"whatsapp\" | \"twitter\" | \"telegram\"",
"required": false,
"description": "The visual color appearance of the component"
},
Expand Down
15 changes: 14 additions & 1 deletion packages/props-docs/generated/box.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,18 @@
"description": "The size (width and height) of the square"
}
},
"Circle": {}
"Circle": {
"centerContent": {
"type": "boolean",
"defaultValue": false,
"required": false,
"description": "If `true`, the content will be centered in the square"
},
"size": {
"type": "ResponsiveValue<string | number | (string & {})>",
"required": false,
"description": "The size (width and height) of the square"
}
},
"Span": {}
}