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

Adds Icon page back to .design #370

Merged
merged 4 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18,023 changes: 5,783 additions & 12,240 deletions package-lock.json

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,44 +19,44 @@
"@leafygreen-ui/callout": "^9.0.22",
"@leafygreen-ui/card": "^10.0.7",
"@leafygreen-ui/code": "^14.3.3",
"@leafygreen-ui/combobox": "^9.0.0",
"@leafygreen-ui/confirmation-modal": "^5.0.14",
"@leafygreen-ui/combobox": "^9.1.0",
"@leafygreen-ui/confirmation-modal": "^5.2.0",
"@leafygreen-ui/copyable": "^8.0.25",
"@leafygreen-ui/date-picker": "^1.1.3",
"@leafygreen-ui/date-picker": "^1.2.0",
"@leafygreen-ui/empty-state": "^1.0.17",
"@leafygreen-ui/expandable-card": "^3.2.2",
"@leafygreen-ui/form-footer": "^3.1.4",
"@leafygreen-ui/guide-cue": "^5.0.8",
"@leafygreen-ui/icon": "^12.3.0",
"@leafygreen-ui/form-footer": "^4.0.0",
"@leafygreen-ui/guide-cue": "^5.1.0",
"@leafygreen-ui/icon": "^12.5.3",
"@leafygreen-ui/icon-button": "^15.0.21",
"@leafygreen-ui/info-sprinkle": "^1.0.5",
"@leafygreen-ui/leafygreen-provider": "^3.1.12",
"@leafygreen-ui/loading-indicator": "^2.0.12",
"@leafygreen-ui/logo": "^9.1.1",
"@leafygreen-ui/marketing-modal": "^4.2.3",
"@leafygreen-ui/modal": "^16.0.7",
"@leafygreen-ui/number-input": "^2.0.0",
"@leafygreen-ui/modal": "^16.0.8",
"@leafygreen-ui/number-input": "^2.2.0",
"@leafygreen-ui/pagination": "^1.0.24",
"@leafygreen-ui/password-input": "^2.0.0",
"@leafygreen-ui/pipeline": "^5.0.20",
"@leafygreen-ui/radio-box-group": "^13.0.0",
"@leafygreen-ui/radio-group": "^11.0.1",
"@leafygreen-ui/search-input": "^3.0.1",
"@leafygreen-ui/segmented-control": "^8.2.12",
"@leafygreen-ui/select": "^12.0.0",
"@leafygreen-ui/search-input": "^3.1.0",
"@leafygreen-ui/segmented-control": "^8.2.13",
"@leafygreen-ui/select": "^12.1.0",
"@leafygreen-ui/side-nav": "^14.1.3",
"@leafygreen-ui/skeleton-loader": "^1.2.0",
"@leafygreen-ui/split-button": "^1.0.13",
"@leafygreen-ui/split-button": "^1.1.0",
"@leafygreen-ui/stepper": "^3.2.13",
"@leafygreen-ui/table": "^12.6.3",
"@leafygreen-ui/tabs": "^11.2.0",
"@leafygreen-ui/text-area": "^9.0.0",
"@leafygreen-ui/text-input": "^13.0.2",
"@leafygreen-ui/tabs": "^12.0.0",
"@leafygreen-ui/text-area": "^9.1.0",
"@leafygreen-ui/text-input": "^13.1.0",
"@leafygreen-ui/toast": "^6.1.25",
"@leafygreen-ui/toggle": "^10.1.1",
"@leafygreen-ui/tokens": "^2.7.0",
"@leafygreen-ui/tooltip": "^11.0.4",
"@leafygreen-ui/typography": "^19.1.1",
"@leafygreen-ui/tokens": "^2.8.0",
"@leafygreen-ui/tooltip": "^11.1.0",
"@leafygreen-ui/typography": "^19.1.2",
"@lg-tools/storybook-utils": "^0.1.1",
"@next/third-parties": "^14.2.3",
"@storybook/react": "^8.0.10",
Expand Down
6 changes: 1 addition & 5 deletions src/app/[contentPageGroup]/[contentPage]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ export default async function ContentPage({
const contentPage = await getContentPage(startCase(contentPageName));

return (
<div
className={css`
max-width: 700px; // TODO: Make this responsive
`}
>
<div>
<ContentstackRichText content={contentPage?.content} />
</div>
);
Expand Down
16 changes: 16 additions & 0 deletions src/app/[contentPageGroup]/[contentPage]/template.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use client';

import { css } from '@emotion/css';

export default function Layout({ children }: { children: React.ReactNode }) {
return (
<div
id="layout"
className={css`
max-width: 700px;
`}
>
{children}
</div>
);
}
6 changes: 0 additions & 6 deletions src/app/component/[component]/code-docs/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ export function parseComponentPropsFromTSDocs(
return reducedPropTables;
} else {
const centralProps = tsDocs.find(tsdoc => {
console.log({
displayName: tsdoc.displayName,
kebabCaseDisplay: kebabCase(tsdoc.displayName),
componentName,
kebabCaseName: kebabCase(componentName),
});
return kebabCase(tsdoc.displayName).includes(kebabCase(componentName));
});
const mergedProps = mergeProps(centralProps?.props);
Expand Down
1 change: 0 additions & 1 deletion src/app/component/[component]/live-example/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { loadStories } from './server';
import { Knobs } from '@/components/live-example/Knobs';
import { useDarkMode } from '@leafygreen-ui/leafygreen-provider';
import { createDefaultProps } from './utils';
import { CardSkeleton } from '@leafygreen-ui/skeleton-loader';

export default function Page({ params }: { params: { component: string } }) {
const { darkMode } = useDarkMode();
Expand Down
4 changes: 3 additions & 1 deletion src/app/component/[component]/live-example/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { composeStories } from '@storybook/react';
export async function loadStories(componentName: string) {
try {
const stories = await import(`@leafygreen-ui/${componentName}/stories`);
const { LiveExample, default: meta } = composeStories(stories);
const { LiveExample, default: extractMeta } = composeStories(stories);
const meta = extractMeta ?? stories.default;

return { LiveExample, meta } as StoryData;
} catch (error) {
console.log('ERROR LOADING STORIES');
Expand Down
1 change: 0 additions & 1 deletion src/app/component/[component]/live-example/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { StoryData } from '@/components/live-example';
import { mergeObjects } from '@/utils';
import { Meta } from '@storybook/react';

Expand Down
2 changes: 1 addition & 1 deletion src/components/content-stack/ContentstackRichText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const ContentStackRichText = ({
}: CSRichTextProps): JSX.Element => {
return (
<ErrorBoundary
errorComponent={err => {
errorComponent={() => {
console.error(
'The above error occurred mapping the following content to an element',
content,
Expand Down
7 changes: 7 additions & 0 deletions src/components/global/SideNavigation/SideNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ export function SideNavigation() {
}
/>
<SideNavList key="foundation-list">
<SideNavItem
key="grid"
active={pathname === '/foundations/forms/'}
href={'/foundations/forms'}
>
Form Guidelines
</SideNavItem>
<SideNavItem
key="grid"
active={pathname === '/foundations/grid/'}
Expand Down
2 changes: 1 addition & 1 deletion src/components/live-example/KnobRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const KnobRow = ({ knob, knobValue, setKnobValue }: KnobRowProps) => {
const renderedKnob = (
<Knob
propName={name}
knobType={control}
knobType={control === 'color' ? 'text' : control}
knobOptions={options}
value={knobValue}
onChange={eventOrVal => {
Expand Down
1 change: 1 addition & 0 deletions src/components/live-example/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export type ComponentProps = { [key: string]: any };
export type Knobs =
| 'string'
| 'text'
| 'color'
| 'number'
| 'range'
| 'date'
Expand Down
6 changes: 6 additions & 0 deletions src/utils/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const Component = {
ExpandableCard: 'expandable-card',
FormFooter: 'form-footer',
GuideCue: 'guide-cue',
Icon: 'icon',
IconButton: 'icon-button',
InfoSprinkle: 'info-sprinkle',
InlineDefinition: 'inline-definition',
Expand Down Expand Up @@ -161,6 +162,11 @@ export const components: Array<ComponentMeta> = [
navPath: generateComponentNavPath(Component.GuideCue),
group: Group.Dialogs,
},
{
name: titlecase(Component.Icon),
navPath: generateComponentNavPath(Component.Icon),
group: Group.Display,
},
{
name: titlecase(Component.IconButton),
navPath: generateComponentNavPath(Component.IconButton),
Expand Down
Loading