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

UI: Improve Button layout and props #23356

Merged
merged 38 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
aaaf575
Adding the new Button props
cdedreuille Jul 7, 2023
630b913
Button updates
cdedreuille Jul 7, 2023
defe8c2
Improve the button style
cdedreuille Jul 9, 2023
7099b19
Update Button story
cdedreuille Jul 9, 2023
060106c
Add missing Link
cdedreuille Jul 9, 2023
6c25e59
Improve styling for link
cdedreuille Jul 9, 2023
2397b46
Improve theme layout to work with docs
cdedreuille Jul 10, 2023
2cd1e0a
Fix dark theme button
cdedreuille Jul 10, 2023
f749b6a
Update preview.tsx
cdedreuille Jul 10, 2023
7e0843c
Add missing props
cdedreuille Jul 10, 2023
9292465
Update Button.stories.tsx
cdedreuille Jul 10, 2023
2b5ee72
Merge branch 'next' into charles/update-button
cdedreuille Jul 11, 2023
e7755c6
Update Button.tsx
cdedreuille Jul 11, 2023
8c636e0
Add new command line
cdedreuille Jul 11, 2023
7c73321
Add package.json
cdedreuille Jul 11, 2023
fad9520
Add new button
cdedreuille Jul 11, 2023
435e825
Add tsconfig and readme
cdedreuille Jul 11, 2023
841798b
Add missing files
cdedreuille Jul 11, 2023
5d48c34
Bring back old component
cdedreuille Jul 11, 2023
ab7fd6d
Update preview.tsx
cdedreuille Jul 11, 2023
b030f45
Remove Chromatic as a dependency
cdedreuille Jul 11, 2023
011be25
Update styles.ts
cdedreuille Jul 11, 2023
f84cef2
Improve styling for all buttons
cdedreuille Jul 11, 2023
6404233
Update CircleCi
cdedreuille Jul 11, 2023
ec36ee4
move ui/components/src into ui/components/src/legacy
ndelangen Jul 12, 2023
013ac74
Merge branch 'next' into charles/update-button
ndelangen Jul 12, 2023
1d918f8
Merge branch 'charles/update-button' of https://github.com/storybookj…
cdedreuille Jul 12, 2023
4ad8d8e
Fix Storybook
cdedreuille Jul 12, 2023
9223ba6
Update main.ts
cdedreuille Jul 12, 2023
a3b01c7
Remove old button
cdedreuille Jul 12, 2023
477ac69
Styles
cdedreuille Jul 12, 2023
f7c0e64
Cleanup Button
kasperpeulen Jul 12, 2023
cf0168c
Merge branch 'next' into charles/update-button
cdedreuille Jul 12, 2023
3e53034
Remove unnecessary commands
cdedreuille Jul 12, 2023
24abad2
fix
ndelangen Jul 12, 2023
69dd3d4
Merge branch 'next' into charles/update-button
cdedreuille Jul 12, 2023
4f3f156
Merge branch 'next' into charles/update-button
cdedreuille Jul 12, 2023
d45d3c9
Merge branch 'release/7.2' into charles/update-button
ndelangen Jul 12, 2023
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
12 changes: 8 additions & 4 deletions code/ui/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@ import type { StorybookConfig } from '../../frameworks/react-vite';
const isBlocksOnly = process.env.STORYBOOK_BLOCKS_ONLY === 'true';

const allStories = [
{
directory: '../components/src/new',
titlePrefix: '@core-ui',
},
{
directory: '../manager/src',
titlePrefix: '@storybook-manager',
titlePrefix: '@manager',
},
{
directory: '../components/src',
titlePrefix: '@storybook-components',
directory: '../components/src/legacy',
titlePrefix: '@components',
},
{
directory: '../blocks/src',
titlePrefix: '@storybook-blocks',
titlePrefix: '@blocks',
},
];

Expand Down
22 changes: 21 additions & 1 deletion code/ui/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"./experimental": {
"types": "./dist/experimantal.d.ts",
"node": "./dist/experimantal.js",
"require": "./dist/experimantal.js",
"import": "./dist/experimantal.mjs"
},
"./html": {
"types": "./dist/html.d.ts",
"require": "./dist/html.js",
Expand All @@ -37,6 +43,19 @@
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typesVersions": {
"*": {
"*": [
"dist/index.d.ts"
],
"html": [
"dist/html.d.ts"
],
"experimental": [
"dist/experimantal.d.ts"
]
}
},
"files": [
"dist/**/*",
"README.md",
Expand Down Expand Up @@ -81,7 +100,8 @@
},
"bundler": {
"entries": [
"./src/index.ts"
"./src/index.ts",
"./src/experimantal.ts"
],
"platform": "neutral"
},
Expand Down
10 changes: 10 additions & 0 deletions code/ui/components/src/experimantal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
/// <reference path="./typings.d.ts" />

/* ABSOLUTELY DO NOT:
* - EXPORT PROPS INTERFACES OF COMPONENTS
* - EXPORT * FROM ANY FILES, EVERY EXPORT SHOULD BE DELIBERATE
* - EXPORT IMPORT / EXPORT ANYTHING FROM LEGACY
*/

export { Button } from './new/Button/Button';
121 changes: 62 additions & 59 deletions code/ui/components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,88 +3,91 @@

import type { ElementType } from 'react';
import { createElement, forwardRef } from 'react';
import * as typography from './typography/components';

export { A } from './typography/elements/A';
export { Blockquote } from './typography/elements/Blockquote';
export { Code } from './typography/elements/Code';
export { Div } from './typography/elements/Div';
export { DL } from './typography/elements/DL';
export { H1 } from './typography/elements/H1';
export { H2 } from './typography/elements/H2';
export { H3 } from './typography/elements/H3';
export { H4 } from './typography/elements/H4';
export { H5 } from './typography/elements/H5';
export { H6 } from './typography/elements/H6';
export { HR } from './typography/elements/HR';
export { Img } from './typography/elements/Img';
export { LI } from './typography/elements/LI';
export { OL } from './typography/elements/OL';
export { P } from './typography/elements/P';
export { Pre } from './typography/elements/Pre';
export { Span } from './typography/elements/Span';
export { Table } from './typography/elements/Table';
export { TT } from './typography/elements/TT';
export { UL } from './typography/elements/UL';
export { Badge } from './Badge/Badge';
import * as typography from './legacy/typography/components';

export { A } from './legacy/typography/elements/A';
export { Blockquote } from './legacy/typography/elements/Blockquote';
export { Code } from './legacy/typography/elements/Code';
export { Div } from './legacy/typography/elements/Div';
export { DL } from './legacy/typography/elements/DL';
export { H1 } from './legacy/typography/elements/H1';
export { H2 } from './legacy/typography/elements/H2';
export { H3 } from './legacy/typography/elements/H3';
export { H4 } from './legacy/typography/elements/H4';
export { H5 } from './legacy/typography/elements/H5';
export { H6 } from './legacy/typography/elements/H6';
export { HR } from './legacy/typography/elements/HR';
export { Img } from './legacy/typography/elements/Img';
export { LI } from './legacy/typography/elements/LI';
export { OL } from './legacy/typography/elements/OL';
export { P } from './legacy/typography/elements/P';
export { Pre } from './legacy/typography/elements/Pre';
export { Span } from './legacy/typography/elements/Span';
export { Table } from './legacy/typography/elements/Table';
export { TT } from './legacy/typography/elements/TT';
export { UL } from './legacy/typography/elements/UL';
export { Badge } from './legacy/Badge/Badge';

// Typography
export { Link } from './typography/link/link';
export { DocumentWrapper } from './typography/DocumentWrapper';
export { Link } from './legacy/typography/link/link';
export { DocumentWrapper } from './legacy/typography/DocumentWrapper';
export type {
SyntaxHighlighterFormatTypes,
SyntaxHighlighterProps,
SyntaxHighlighterRendererProps,
} from './syntaxhighlighter/syntaxhighlighter-types';
export { SyntaxHighlighter } from './syntaxhighlighter/lazy-syntaxhighlighter';
export { createCopyToClipboardFunction } from './syntaxhighlighter/syntaxhighlighter';
} from './legacy/syntaxhighlighter/syntaxhighlighter-types';
export { SyntaxHighlighter } from './legacy/syntaxhighlighter/lazy-syntaxhighlighter';
export { createCopyToClipboardFunction } from './legacy/syntaxhighlighter/syntaxhighlighter';

// UI
export { ActionBar } from './ActionBar/ActionBar';
export { Spaced } from './spaced/Spaced';
export { Placeholder } from './placeholder/placeholder';
export { ScrollArea } from './ScrollArea/ScrollArea';
export { Zoom } from './Zoom/Zoom';
export type { ActionItem } from './ActionBar/ActionBar';
export { ErrorFormatter } from './ErrorFormatter/ErrorFormatter';
export { ActionBar } from './legacy/ActionBar/ActionBar';
export { Spaced } from './legacy/spaced/Spaced';
export { Placeholder } from './legacy/placeholder/placeholder';
export { ScrollArea } from './legacy/ScrollArea/ScrollArea';
export { Zoom } from './legacy/Zoom/Zoom';
export type { ActionItem } from './legacy/ActionBar/ActionBar';
export { ErrorFormatter } from './legacy/ErrorFormatter/ErrorFormatter';

// Forms
export { Button } from './Button/Button';
export { Form } from './form/index';
export { Button } from './legacy/Button/Button';
export { Form } from './legacy/form/index';

// Tooltips
export { WithTooltip, WithTooltipPure } from './tooltip/lazy-WithTooltip';
export { TooltipMessage } from './tooltip/TooltipMessage';
export { TooltipNote } from './tooltip/TooltipNote';
export { TooltipLinkList, type Link as TooltipLinkListLink } from './tooltip/TooltipLinkList';
export { default as ListItem } from './tooltip/ListItem';
export { WithTooltip, WithTooltipPure } from './legacy/tooltip/lazy-WithTooltip';
export { TooltipMessage } from './legacy/tooltip/TooltipMessage';
export { TooltipNote } from './legacy/tooltip/TooltipNote';
export {
TooltipLinkList,
type Link as TooltipLinkListLink,
} from './legacy/tooltip/TooltipLinkList';
export { default as ListItem } from './legacy/tooltip/ListItem';

// Toolbar and subcomponents
export { Tabs, TabsState, TabBar, TabWrapper } from './tabs/tabs';
export { IconButton, IconButtonSkeleton, TabButton } from './bar/button';
export { Separator, interleaveSeparators } from './bar/separator';
export { Bar, FlexBar } from './bar/bar';
export { AddonPanel } from './addon-panel/addon-panel';
export { Tabs, TabsState, TabBar, TabWrapper } from './legacy/tabs/tabs';
export { IconButton, IconButtonSkeleton, TabButton } from './legacy/bar/button';
export { Separator, interleaveSeparators } from './legacy/bar/separator';
export { Bar, FlexBar } from './legacy/bar/bar';
export { AddonPanel } from './legacy/addon-panel/addon-panel';

// Graphics
export type { IconsProps } from './icon/icon';
export { Icons, Symbols } from './icon/icon';
export { icons } from './icon/icons';
export { StorybookLogo } from './brand/StorybookLogo';
export { StorybookIcon } from './brand/StorybookIcon';
export type { IconsProps } from './legacy/icon/icon';
export { Icons, Symbols } from './legacy/icon/icon';
export { icons } from './legacy/icon/icons';
export { StorybookLogo } from './legacy/brand/StorybookLogo';
export { StorybookIcon } from './legacy/brand/StorybookIcon';

// Loader
export { Loader } from './Loader/Loader';
export { Loader } from './legacy/Loader/Loader';

// Utils
export { getStoryHref } from './utils/getStoryHref';
export { getStoryHref } from './legacy/utils/getStoryHref';

export * from './typography/DocumentFormatting';
export * from './typography/ResetWrapper';
export * from './legacy/typography/DocumentFormatting';
export * from './legacy/typography/ResetWrapper';

export { withReset, codeCommon } from './typography/lib/common';
export { withReset, codeCommon } from './legacy/typography/lib/common';

export { ClipboardCode } from './clipboard/ClipboardCode';
export { ClipboardCode } from './legacy/clipboard/ClipboardCode';

// eslint-disable-next-line prefer-destructuring
export const components = typography.components;
Expand Down
Loading