;
27 | export {};
28 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/utils/types.d.ts:
--------------------------------------------------------------------------------
1 | import { ItemRenderer } from '@react-types/shared';
2 | import React from 'react';
3 | export declare type MaybeRenderProp = R | ((props: P) => R);
4 | export declare type MaybeRenderPropWithState
= R | ((props: P, state: S) => R);
5 | export declare type Placement = 'bottom' | 'bottom left' | 'bottom right' | 'top' | 'top left' | 'top right' | 'left' | 'left top' | 'left bottom' | 'right' | 'right top' | 'right bottom';
6 | export interface PartialSpectrumCollectionNode {
7 | type?: 'item' | 'section' | string;
8 | key?: React.Key;
9 | value?: T;
10 | element?: React.ReactElement;
11 | wrapper?: (element: React.ReactElement) => React.ReactElement;
12 | rendered?: React.ReactNode;
13 | textValue?: string;
14 | 'aria-label'?: string;
15 | index?: number;
16 | renderer?: ItemRenderer;
17 | hasChildNodes?: boolean;
18 | childNodes?: () => IterableIterator>;
19 | props?: any;
20 | shouldInvalidate?: (context: unknown) => boolean;
21 | }
22 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/components/Modal/Modal.d.ts:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | export declare type ModalProps = {
3 | title: React.ReactElement | string;
4 | /**
5 | * The content to render in the Modal.
6 | */
7 | children: React.ReactNode;
8 | /**
9 | * The content to render in the footer slot.
10 | */
11 | footer?: React.ReactElement | string;
12 | /**
13 | * Whether the Modal is open.
14 | */
15 | isOpen: boolean;
16 | /**
17 | * Called when the Modal closes.
18 | */
19 | onClose: () => void;
20 | /**
21 | * When true the user will be able to interact with content behind the modal, and move the modal around.
22 | */
23 | isDraggable?: boolean;
24 | /**
25 | * Whether to prevent closing the overlay when the user interacts outside of it.
26 | */
27 | isNotDismissable?: boolean;
28 | };
29 | export declare const useModalState: () => {
30 | isOpen: boolean;
31 | open: () => void;
32 | close: () => void;
33 | };
34 | export declare const Modal: (props: ModalProps) => JSX.Element;
35 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/utils/assertion.d.ts:
--------------------------------------------------------------------------------
1 | import { ChangeEvent } from 'react';
2 | export declare type Dict = Record;
3 | export declare function isNumber(value: any): value is number;
4 | export declare const isNotNumber: (value: any) => boolean;
5 | export declare function isNumeric(value: any): boolean;
6 | export declare function isArray(value: any): value is Array;
7 | export declare const isEmptyArray: (value: any) => boolean;
8 | export declare function isFunction(value: any): value is Function;
9 | export declare const isDefined: (value: any) => boolean;
10 | export declare const isUndefined: (value: any) => value is undefined;
11 | export declare const isObject: (value: any) => value is Record;
12 | export declare const isEmptyObject: (value: any) => boolean;
13 | export declare function isNotEmptyObject(value: any): value is object;
14 | export declare const isNull: (value: any) => value is null;
15 | export declare function isString(value: any): value is string;
16 | export declare function isInputEvent(value: any): value is ChangeEvent;
17 | export declare const isEmpty: (value: any) => boolean;
18 | export declare const __DEV__: boolean;
19 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/enhancers/size.d.ts:
--------------------------------------------------------------------------------
1 | import { SpaceVals } from './spacing';
2 | import { EnhancerFn } from './types';
3 | export declare type HeightVals = SpaceVals | 'auto' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full' | 'screen';
4 | export declare type MaxHeightVals = 'full' | 'screen';
5 | export declare type MinHeightVals = 'full' | 'screen';
6 | export declare type WidthVals = SpaceVals | 'auto' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '1/2' | '1/3' | '2/3' | '1/4' | '2/4' | '3/4' | '1/5' | '2/5' | '3/5' | '4/5' | '1/6' | '2/6' | '3/6' | '4/6' | '5/6' | 'full' | 'screen' | 'min' | 'max';
7 | export declare type MaxWidthVals = 'none' | 'full' | 'min' | 'max' | 'prose';
8 | export declare type MinWidthVals = 'full' | 'min' | 'max';
9 | export interface IHeightProps {
10 | h?: HeightVals;
11 | maxH?: MaxHeightVals;
12 | minH?: MinHeightVals;
13 | }
14 | export interface IWidthProps {
15 | w?: WidthVals;
16 | maxW?: MaxWidthVals;
17 | minW?: MinWidthVals;
18 | }
19 | export interface ISizeProps extends IHeightProps, IWidthProps {
20 | }
21 | export declare const sizePropNames: Array;
22 | export declare const sizeProps: EnhancerFn;
23 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/components/Button/Button.d.ts:
--------------------------------------------------------------------------------
1 | import './style.css';
2 | import { FocusableProps, PressEvents } from '@react-types/shared';
3 | import React, { RefObject } from 'react';
4 | import { IntentVals } from '../../enhancers';
5 | import { PolymorphicComponentProps } from '../Box/types';
6 | import { IIconProps } from '../Icon';
7 | import { AppearanceVals } from './variants';
8 | export declare type ButtonOwnProps = PressEvents & FocusableProps & {
9 | children?: React.ReactNode;
10 | appearance?: AppearanceVals;
11 | intent?: IntentVals;
12 | size?: 'sm' | 'md';
13 | active?: boolean;
14 | disabled?: boolean;
15 | loading?: boolean;
16 | icon?: IIconProps['icon'] | React.ReactElement;
17 | iconRight?: IIconProps['icon'] | React.ReactElement;
18 | autoFocus?: boolean;
19 | label?: string;
20 | };
21 | export declare type ButtonProps = PolymorphicComponentProps;
22 | declare const defaultElement = "button";
23 | export declare const Button: (props: ButtonProps & {
24 | ref?: RefObject;
25 | }) => JSX.Element;
26 | export {};
27 |
--------------------------------------------------------------------------------
/pages/_app.tsx:
--------------------------------------------------------------------------------
1 | import '../styles.css';
2 |
3 | import { Provider, subscribeTheme } from '@stoplight/mosaic';
4 | import { AppProps } from 'next/app';
5 | import dynamic from 'next/dynamic';
6 | import Head from 'next/head';
7 | import { DefaultSeo } from 'next-seo';
8 | import * as React from 'react';
9 |
10 | import SEO from '../next-seo.config';
11 |
12 | if (process.browser) {
13 | subscribeTheme();
14 | }
15 |
16 | const GlobalProgressBar = dynamic(() => import('../components/GlobalProgressBar').then(mod => mod.GlobalProgressBar), {
17 | ssr: false,
18 | });
19 |
20 | function App({ Component, pageProps }: AppProps) {
21 | /** Keep an eye out for full remounts, we want to minimize those */
22 | React.useEffect(() => console.info('App.mount'), []);
23 |
24 | // @ts-expect-error
25 | const getLayout = Component.getLayout || (page => page);
26 |
27 | return (
28 | <>
29 |
30 |
31 |
32 |
33 |
34 |
35 | {getLayout( )}
36 |
37 |
38 | >
39 | );
40 | }
41 |
42 | export default App;
43 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/components/Tabs/Tabs.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export declare type TabsOwnProps = {
3 | /**
4 | * Must contain `TabList` and `TabPanel` components.
5 | */
6 | children: React.ReactNode;
7 | /**
8 | * ID that will serve as a base for all the generated tab IDs.
9 | */
10 | id?: string;
11 | /**
12 | * The current selected tab's `id`.
13 | */
14 | selectedId?: string;
15 | /**
16 | * Callback for when the selected tab state changes.
17 | */
18 | onChange?: (selectedId: string) => void;
19 | /**
20 | * Defines the direction the tabs are displayed. Defaults to horizontal.
21 | */
22 | direction?: 'horizontal' | 'vertical';
23 | /**
24 | * Defines how large the tabs should be.
25 | */
26 | size?: 'sm' | 'lg';
27 | /**
28 | * The alignment of the tabs.
29 | */
30 | align?: 'center' | 'end' | 'start';
31 | /**
32 | * Performance: If `true`, the TabPanel rendering will be deferred until it is open.
33 | */
34 | isEager?: boolean;
35 | };
36 | export declare const Tabs: ({ children, id, selectedId, onChange, direction, size, align, isEager, }: TabsOwnProps) => JSX.Element;
37 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/hooks/use-controllable-state.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export declare function useControllableProp(prop: T | undefined, state: T): readonly [boolean, T];
3 | export interface IUseControllableStateProps {
4 | /**
5 | * The value to used in controlled mode
6 | */
7 | value?: T;
8 | /**
9 | * The initial value to be used, in uncontrolled mode
10 | */
11 | defaultValue?: T | (() => T);
12 | /**
13 | * The callback fired when the value changes
14 | */
15 | onChange?: (value: T) => void;
16 | /**
17 | * The component name (for warnings)
18 | */
19 | name?: string;
20 | /**
21 | * A mapping for the props to give more contextual warning messages.
22 | *
23 | * In some components `value` might be called `index`, and defaultValue
24 | * might be called `defaultIndex`, so this map helps us generate
25 | * contextual warning messages
26 | */
27 | propsMap?: {
28 | value: string;
29 | defaultValue: string;
30 | onChange: string;
31 | };
32 | }
33 | /**
34 | * React hook for using controlling component state.
35 | * @param props
36 | */
37 | export declare function useControllableState(props: IUseControllableStateProps): [T, React.Dispatch>];
38 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/utils/theme.d.ts:
--------------------------------------------------------------------------------
1 | import { HslColor2 } from './color-manipulation';
2 | export declare type ThemeMode = 'light' | 'dark' | 'system';
3 | declare type Color = string;
4 | export interface ITheme {
5 | colors: {
6 | background: Color;
7 | text?: Color;
8 | primary: Color;
9 | success: Color;
10 | warning: Color;
11 | danger: Color;
12 | };
13 | }
14 | export interface ICustomTheme {
15 | colors: Partial;
16 | }
17 | export declare type ColorValues = {
18 | light?: boolean;
19 | } & Record, HslColor2>;
20 | export declare const defaultTheme: ITheme;
21 | export declare const getCssVariable: (name: string, element?: HTMLElement) => string;
22 | export declare const prefersDarkMode: () => MediaQueryList;
23 | /**
24 | * Handles figuring out what 'system' mode resolves to if user has that picked. Always returns light | dark.
25 | */
26 | export declare const getResolvedThemeMode: (userMode: ThemeMode) => "light" | "dark";
27 | export declare const computeTheme: (customTheme: ICustomTheme, $mode?: ThemeMode) => {
28 | mult: {
29 | s: number;
30 | l: number;
31 | };
32 | colorValues: ColorValues;
33 | invertedColorValues: ColorValues;
34 | css: string;
35 | };
36 | export {};
37 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/components/Stack/Stack.d.ts:
--------------------------------------------------------------------------------
1 | import './style.css';
2 | import React from 'react';
3 | import { IFlexShorthandProps } from '../../enhancers';
4 | import { PolymorphicComponentProps } from '../Box';
5 | export declare type StackOwnProps = Pick & {
6 | /**
7 | * The direction to render the stack
8 | */
9 | direction?: 'vertical' | 'horizontal';
10 | /**
11 | * The space between each stack item
12 | */
13 | spacing?: 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 20 | 24 | 32;
14 | /**
15 | * If `true`, each stack item will show a divider
16 | */
17 | divider?: true | React.ReactElement;
18 | /**
19 | * If `true`, will render as `inline-flex` rather than `flex`
20 | */
21 | inline?: boolean;
22 | };
23 | export declare type StackProps = PolymorphicComponentProps;
24 | declare const defaultElement = "div";
25 | export declare const Stack: (props: StackProps) => JSX.Element;
26 | export declare const HStack: (props: StackProps) => JSX.Element;
27 | export declare const VStack: (props: StackProps) => JSX.Element;
28 | export {};
29 |
--------------------------------------------------------------------------------
/pages/_document.tsx:
--------------------------------------------------------------------------------
1 | import { Box, InitTheme, InlineStyles } from '@stoplight/mosaic';
2 | import Document, { DocumentContext, Head, Html, Main, NextScript } from 'next/document';
3 | import * as React from 'react';
4 |
5 | class CustomDocument extends Document {
6 | static getInitialProps(ctx: DocumentContext) {
7 | return Document.getInitialProps(ctx);
8 | }
9 |
10 | render() {
11 | return (
12 |
13 |
14 |
15 |
16 |
17 |
22 |
23 |
24 |
25 |
26 |
35 |
36 |
37 |
38 |
39 |
40 | );
41 | }
42 | }
43 |
44 | export default CustomDocument;
45 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/enhancers/spacing.d.ts:
--------------------------------------------------------------------------------
1 | import { EnhancerFn } from './types';
2 | export declare type SpaceVals = 'auto' | 'px' | 0 | 0.5 | 1 | 1.5 | 2 | 2.5 | 3 | 3.5 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 20 | 24 | 32 | 40 | 60 | 80;
3 | export declare type NegativeSpaceVals = '-px' | -0 | -0.5 | -1 | -1.5 | -2 | -2.5 | -3 | -3.5 | -4 | -5 | -6 | -7 | -8 | -9 | -10 | -11 | -12 | -14 | -16 | -20 | -24 | -32 | -40 | -60 | -80;
4 | export interface IMarginProps {
5 | m?: SpaceVals | NegativeSpaceVals;
6 | mx?: SpaceVals | NegativeSpaceVals;
7 | my?: SpaceVals | NegativeSpaceVals;
8 | mt?: SpaceVals | NegativeSpaceVals;
9 | mr?: SpaceVals | NegativeSpaceVals;
10 | mb?: SpaceVals | NegativeSpaceVals;
11 | ml?: SpaceVals | NegativeSpaceVals;
12 | }
13 | export interface IPaddingProps {
14 | p?: SpaceVals;
15 | px?: SpaceVals;
16 | py?: SpaceVals;
17 | pt?: SpaceVals;
18 | pr?: SpaceVals;
19 | pb?: SpaceVals;
20 | pl?: SpaceVals;
21 | }
22 | export interface ISpacingProps extends IMarginProps, IPaddingProps {
23 | }
24 | export declare const isNegative: (v: number | string) => boolean;
25 | export declare const buildClassname: (p: string, v: number | string) => string;
26 | export declare const spacingPropNames: Array;
27 | export declare const marginProps: EnhancerFn;
28 | export declare const paddingProps: EnhancerFn;
29 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/utils/split-box-props.d.ts:
--------------------------------------------------------------------------------
1 | import { IBorderProps, IColorProps, IFlexProps, IInteractivityProps, ILayoutProps, IPositionProps, IShadowProps, ISizeProps, ISpacingProps, ITypographyProps } from '../enhancers';
2 | interface IEnhancerProps extends IBorderProps, IColorProps, IFlexProps, IInteractivityProps, ILayoutProps, IPositionProps, IShadowProps, ISizeProps, ISpacingProps, ITypographyProps {
3 | }
4 | interface SplitBoxProps {
5 | matchedProps: Pick
;
6 | remainingProps: Pick
>;
7 | }
8 | /**
9 | * Convenience method to split the Box props.
10 | *
11 | * Useful for when you want to pass all of the Box props to the root Box and
12 | * pass the remaining props to a child element (e.g: disabled, readOnly, required, etc).
13 | */
14 | export declare function splitBoxProps
(props: P): SplitBoxProps
;
15 | declare type Omit, K extends keyof T> = Pick>;
16 | interface Dictionary {
17 | [key: string]: T;
18 | }
19 | export interface SplitProps {
20 | matchedProps: Pick
;
21 | remainingProps: Omit
;
22 | }
23 | /**
24 | * Utility to split props based on an array of keys
25 | */
26 | export declare function splitProps
, K extends keyof P>(props: P, keys: K[]): SplitProps
;
27 | export {};
28 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/index.d.ts:
--------------------------------------------------------------------------------
1 | export * from './enhancers';
2 | export * from './hooks';
3 | export * from './utils';
4 | export * from './styles';
5 | export * from './components/Article';
6 | export * from './components/Avatar';
7 | export * from './components/Box';
8 | export * from './components/Button';
9 | export * from './components/Card';
10 | export * from './components/Code';
11 | export * from './components/Container';
12 | export * from './components/Modal';
13 | export * from './components/Divider';
14 | export * from './components/EntityName';
15 | export * from './components/Flex';
16 | export * from './components/Grid';
17 | export * from './components/Heading';
18 | export * from './components/Icon';
19 | export * from './components/Image';
20 | export * from './components/Input';
21 | export * from './components/Link';
22 | export * from './components/LinkHeading';
23 | export * from './components/Menu';
24 | export * from './components/NoSsr';
25 | export * from './components/Overlay';
26 | export * from './components/Panel';
27 | export * from './components/Paragraph';
28 | export * from './components/Popover';
29 | export * from './components/Pressable';
30 | export * from './components/Prose';
31 | export * from './components/Provider';
32 | export * from './components/InvertTheme';
33 | export * from './components/Tabs';
34 | export * from './components/Text';
35 | export * from './components/Tooltip';
36 | export * from './components/TreeItem';
37 | export * from './components/Select';
38 | export * from './components/Stack';
39 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/components/Box/types.d.ts:
--------------------------------------------------------------------------------
1 | import { HTMLAttributes } from 'react';
2 | import { IBorderProps, IColorProps, IFlexProps, IInteractivityProps, ILayoutProps, IMarginProps, IPaddingProps, IPositionProps, IRingProps, IShadowProps, ISizeProps, ITypographyProps } from '../../enhancers';
3 | declare type EnhancerProps = ITypographyProps & ISizeProps & IMarginProps & IPaddingProps & IShadowProps & IColorProps & IBorderProps & IRingProps & IInteractivityProps & IFlexProps & IPositionProps & ILayoutProps;
4 | /**
5 | * Generic component props with "as" prop
6 | * @template P Additional props
7 | * @template T React component or string element
8 | */
9 | export declare type BoxOwnProps = EnhancerProps & {
10 | /**
11 | * Replaces the underlying element
12 | */
13 | as?: E;
14 | className?: string;
15 | role?: string;
16 | noFocusRing?: boolean;
17 | };
18 | /**
19 | * Box supports standard HTML attributes
20 | * Box re-defines some props like color, so omit here to prevent clash
21 | */
22 | export interface IBoxHTMLAttributes extends Omit, 'color'> {
23 | }
24 | export declare type BoxProps = BoxOwnProps & Omit, keyof BoxOwnProps>;
25 | export declare type PolymorphicComponentProps = P & BoxProps;
26 | export declare type PolymorphicComponent = (props: PolymorphicComponentProps) => JSX.Element;
27 | export {};
28 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/enhancers/color.d.ts:
--------------------------------------------------------------------------------
1 | import { Pseudo } from './pseudo';
2 | import { EnhancerFn } from './types';
3 | export declare type IntentVals = 'default' | 'success' | 'warning' | 'danger';
4 | export declare type SemanticColorVals = 'link' | 'link-dark' | 'code' | 'on-code' | 'primary' | 'primary-tint' | 'primary-light' | 'primary-dark' | 'on-primary' | 'success' | 'success-tint' | 'success-light' | 'success-dark' | 'on-success' | 'warning' | 'warning-tint' | 'warning-light' | 'warning-dark' | 'on-warning' | 'danger' | 'danger-tint' | 'danger-light' | 'danger-dark' | 'on-danger';
5 | export declare type TextColorVals = 'current' | 'body' | 'muted' | 'light' | 'heading' | 'paragraph' | 'canvas' | 'canvas-pure' | 'canvas-50' | 'canvas-100' | 'canvas-200' | 'canvas-300' | 'canvas-dialog' | SemanticColorVals;
6 | export declare type PlaceholderColorVals = true | 'primary' | 'success' | 'warning' | 'danger';
7 | export interface ITextColorProps {
8 | color?: TextColorVals | Pseudo;
9 | }
10 | export interface IPlaceholderProps {
11 | placeholderColor?: PlaceholderColorVals;
12 | }
13 | export declare type BackgroundColorVals = 'canvas' | 'canvas-pure' | 'canvas-50' | 'canvas-100' | 'canvas-200' | 'canvas-300' | 'canvas-dialog' | 'transparent' | SemanticColorVals;
14 | export interface IBackgroundColorProps {
15 | bg?: BackgroundColorVals | Pseudo;
16 | }
17 | export interface IColorProps extends ITextColorProps, IPlaceholderProps, IBackgroundColorProps {
18 | }
19 | export declare const colorPropNames: Array;
20 | export declare const colorProps: EnhancerFn;
21 |
--------------------------------------------------------------------------------
/layouts/StoplightProjectLayout.tsx:
--------------------------------------------------------------------------------
1 | import { Box, containerSizes, Flex } from '@stoplight/mosaic';
2 | import { useRouter } from 'next/router';
3 | import * as React from 'react';
4 |
5 | import { StoplightProjectSidebar } from '../components/StoplightProjectSidebar';
6 | import { getLayout as getSiteLayout } from './SiteLayout';
7 |
8 | interface StoplightProjectLayoutProps {
9 | title?: string;
10 | description?: string;
11 | children: React.ReactNode;
12 | sidebar?: boolean;
13 | }
14 |
15 | const SIDEBAR_WIDTH = 300;
16 |
17 | export function StoplightProjectLayout(props: StoplightProjectLayoutProps) {
18 | const { children } = props;
19 |
20 | const { query } = useRouter();
21 | const nodeUri = typeof query.docsPath === 'string' ? query.docsPath : query.docsPath?.join('/');
22 | const projectSlug = typeof query.projectSlug === 'string' ? query.projectSlug : query.projectSlug?.join('/');
23 |
24 | React.useEffect(() => console.info('StoplightProjectLayout.mount'), []);
25 |
26 | return (
27 |
28 |
37 |
38 |
39 |
40 |
41 | {children}
42 |
43 |
44 | );
45 | }
46 |
47 | export const getLayout = page => getSiteLayout({page} );
48 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "stoplight-dev-portal",
3 | "version": "1.0.0",
4 | "private": true,
5 | "license": "MIT",
6 | "scripts": {
7 | "dev": "next",
8 | "build": "next build",
9 | "start": "next start",
10 | "lint": "yarn prettier.check && eslint --ext .js,.jsx,.ts,.tsx .",
11 | "prettier.check": "prettier --ignore-path .eslintignore --check '**/*.{js,jsx,ts,tsx,md}'",
12 | "lint.fix": "prettier --ignore-path .eslintignore --write '**/*.{js,jsx,ts,tsx,md}'; eslint --ext .js,.jsx,.ts,.tsx . --fix",
13 | "type-check": "tsc",
14 | "deduplicate": "yarn-deduplicate --strategy fewer && yarn"
15 | },
16 | "dependencies": {
17 | "@stoplight/mosaic": "file:.yalc/@stoplight/mosaic",
18 | "@stoplight/elements": "7.0.0-alpha.3",
19 | "framer-motion": "^3.3.0",
20 | "mobx": "^6.1.7",
21 | "next": "^10.0.7",
22 | "next-seo": "^4.19.0",
23 | "nprogress": "^0.2.0",
24 | "react": "^17.0.1",
25 | "react-dom": "^17.0.1"
26 | },
27 | "devDependencies": {
28 | "@next/bundle-analyzer": "^10.0.7",
29 | "@stoplight/eslint-config": "^2.0.0",
30 | "@types/node": "^14.14.28",
31 | "@types/nprogress": "^0.2.0",
32 | "@types/react": "^17.0.2",
33 | "@types/react-dom": "^17.0.1",
34 | "@typescript-eslint/eslint-plugin": "^4.15.1",
35 | "@typescript-eslint/parser": "^4.15.1",
36 | "eslint": "^7.20.0",
37 | "eslint-plugin-import": "^2.22.1",
38 | "eslint-plugin-jest": "^24.1.5",
39 | "eslint-plugin-prettier": "^3.3.1",
40 | "eslint-plugin-react": "^7.22.0",
41 | "eslint-plugin-react-hooks": "^4.2.0",
42 | "eslint-plugin-simple-import-sort": "^7.0.0",
43 | "next-compose-plugins": "^2.2.1",
44 | "prettier": "^2.2.1",
45 | "typescript": "~4.1.5"
46 | }
47 | }
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@stoplight/mosaic",
3 | "version": "0.0.0-23684a30",
4 | "sideEffects": false,
5 | "peerDependencies": {
6 | "react": ">= 16.8"
7 | },
8 | "resolutions": {
9 | "@react-stately/collections": "npm:@stoplight/react-stately-collections@^3.3.0",
10 | "@react-stately/list": "npm:@stoplight/react-stately-list@^3.2.2"
11 | },
12 | "dependencies": {
13 | "@fortawesome/fontawesome-svg-core": "^1.2.34",
14 | "@fortawesome/free-solid-svg-icons": "^5.15.2",
15 | "@fortawesome/react-fontawesome": "^0.1.14",
16 | "@react-aria/button": "^3.3.1",
17 | "@react-aria/dialog": "^3.1.2",
18 | "@react-aria/focus": "^3.2.3",
19 | "@react-aria/interactions": "^3.3.3",
20 | "@react-aria/listbox": "^3.2.4",
21 | "@react-aria/overlays": "^3.6.1",
22 | "@react-aria/select": "^3.3.0",
23 | "@react-aria/separator": "^3.1.1",
24 | "@react-aria/ssr": "^3.0.1",
25 | "@react-aria/tooltip": "^3.1.1",
26 | "@react-aria/utils": "^3.6.0",
27 | "@react-hook/size": "^2.1.1",
28 | "@react-hook/window-size": "^3.0.7",
29 | "@react-spectrum/utils": "^3.5.1",
30 | "@react-stately/collections": "npm:@stoplight/react-stately-collections@^3.3.0",
31 | "@react-stately/list": "npm:@stoplight/react-stately-list@^3.2.2",
32 | "@react-stately/select": "^3.1.1",
33 | "@react-stately/tooltip": "^3.0.2",
34 | "clsx": "^1.1.1",
35 | "copy-to-clipboard": "^3.3.1",
36 | "deepmerge": "^4.2.2",
37 | "lodash.get": "^4.4.2",
38 | "polished": "^4.0.5",
39 | "reakit": "npm:@stoplight/reakit@~1.3.5",
40 | "ts-keycode-enum": "^1.0.6",
41 | "zustand": "^3.3.1"
42 | },
43 | "main": "./core.umd.js",
44 | "module": "./core.esm.js",
45 | "typings": "./index.d.ts"
46 | }
47 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/enhancers/border.d.ts:
--------------------------------------------------------------------------------
1 | import { SemanticColorVals } from './color';
2 | import { OpacityVals } from './interactivity';
3 | import { Pseudo } from './pseudo';
4 | import { EnhancerFn } from './types';
5 | export declare type OutlineVals = 'none';
6 | export declare type BorderColorVals = 'light' | 'dark' | 'button' | 'input' | 'transparent' | SemanticColorVals;
7 | export declare type BorderWidthVals = true | 0 | 2 | 4 | 8;
8 | export declare type RoundedVals = true | 'none' | 'sm' | 'lg' | 'xl' | 'full' | 'b' | 't' | 'l' | 'r' | 'b-none' | 't-none' | 'l-none' | 'r-none' | 'b-sm' | 't-sm' | 'l-sm' | 'r-sm' | 'b-lg' | 't-lg' | 'l-lg' | 'r-lg' | 'b-xl' | 't-xl' | 'l-xl' | 'r-xl' | 'b-full' | 't-full' | 'l-full' | 'r-full';
9 | export interface IBorderProps {
10 | outline?: OutlineVals;
11 | borderColor?: BorderColorVals | Pseudo;
12 | border?: BorderWidthVals;
13 | borderT?: BorderWidthVals;
14 | borderR?: BorderWidthVals;
15 | borderL?: BorderWidthVals;
16 | borderB?: BorderWidthVals;
17 | rounded?: RoundedVals;
18 | }
19 | export declare const borderPropNames: Array;
20 | export declare const borderProps: EnhancerFn;
21 | export declare type RingWidthVals = true | false;
22 | export declare type RingColorVals = 'primary' | 'success' | 'warning' | 'danger';
23 | export declare type RingOpacityVals = OpacityVals;
24 | export interface IRingProps {
25 | ring?: RingWidthVals | Pseudo;
26 | ringColor?: RingColorVals | Pseudo;
27 | ringOpacity?: RingOpacityVals | Pseudo;
28 | }
29 | export declare const ringPropNames: Array;
30 | export declare const ringProps: EnhancerFn;
31 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/components/Avatar/Avatar.d.ts:
--------------------------------------------------------------------------------
1 | import React, { CSSProperties } from 'react';
2 | import { IMarginProps } from '../../enhancers';
3 | import { IIconProps } from '../Icon';
4 | declare type BaseAvatarProps = IMarginProps & {
5 | size?: 'sm' | 'md' | 'lg';
6 | className?: string;
7 | bg?: CSSProperties['backgroundColor'];
8 | };
9 | export declare type ImageAvatarProps = BaseAvatarProps & {
10 | imageUrl: string;
11 | };
12 | export declare type IconAvatarProps = BaseAvatarProps & {
13 | icon: IIconProps['icon'];
14 | };
15 | export declare type LetterAvatarProps = BaseAvatarProps & {
16 | letter: string;
17 | };
18 | export declare type BlankAvatarProps = BaseAvatarProps & {
19 | blank: true;
20 | };
21 | export declare type AvatarProps = ImageAvatarProps | IconAvatarProps | LetterAvatarProps | BlankAvatarProps;
22 | export declare const Avatar: React.MemoExoticComponent) | (IMarginProps & {
29 | size?: 'sm' | 'md' | 'lg';
30 | className?: string;
31 | bg?: CSSProperties['backgroundColor'];
32 | } & {
33 | icon: IIconProps['icon'];
34 | } & React.RefAttributes) | (IMarginProps & {
35 | size?: 'sm' | 'md' | 'lg';
36 | className?: string;
37 | bg?: CSSProperties['backgroundColor'];
38 | } & {
39 | letter: string;
40 | } & React.RefAttributes) | (IMarginProps & {
41 | size?: 'sm' | 'md' | 'lg';
42 | className?: string;
43 | bg?: CSSProperties['backgroundColor'];
44 | } & {
45 | blank: true;
46 | } & React.RefAttributes)>>;
47 | export {};
48 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/enhancers/flex.d.ts:
--------------------------------------------------------------------------------
1 | import { EnhancerFn } from './types';
2 | export declare type FlexVals = 1 | 'auto' | 'initial' | 'none';
3 | export declare type FlexDirectionVals = 'row' | 'row-reverse' | 'col' | 'col-reverse';
4 | export declare type FlexWrapVals = true | 'reverse' | 'no-wrap';
5 | export declare type FlexGrowVals = true | 0;
6 | export declare type FlexShrinkVals = true | 0;
7 | export declare type JustifyContentVals = 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
8 | export declare type JustifyItemsVals = 'auto' | 'start' | 'end' | 'center' | 'stretch';
9 | export declare type JustifySelfVals = 'auto' | 'start' | 'end' | 'center' | 'stretch';
10 | export declare type AlignContentVals = 'center' | 'flex-start' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
11 | export declare type AlignItemsVals = 'start' | 'end' | 'center' | 'baseline' | 'stretch';
12 | export declare type AlignSelfVals = 'auto' | 'flex-start' | 'flex-end' | 'center' | 'stretch';
13 | export interface IFlexProps {
14 | flex?: FlexVals;
15 | flexDirection?: FlexDirectionVals;
16 | flexWrap?: FlexWrapVals;
17 | flexGrow?: FlexGrowVals;
18 | flexShrink?: FlexShrinkVals;
19 | justifyContent?: JustifyContentVals;
20 | justifyItems?: JustifyItemsVals;
21 | justifySelf?: JustifySelfVals;
22 | alignContent?: AlignContentVals;
23 | alignItems?: AlignItemsVals;
24 | alignSelf?: AlignSelfVals;
25 | }
26 | export interface IFlexShorthandProps {
27 | align?: IFlexProps['alignItems'];
28 | justify?: IFlexProps['justifyContent'];
29 | wrap?: IFlexProps['flexWrap'];
30 | direction?: IFlexProps['flexDirection'];
31 | grow?: IFlexProps['flexGrow'];
32 | shrink?: IFlexProps['flexShrink'];
33 | }
34 | export declare const flexPropNames: Array;
35 | export declare const flexProps: EnhancerFn;
36 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/enhancers/typography.d.ts:
--------------------------------------------------------------------------------
1 | import { EnhancerFn } from './types';
2 | export declare type FontSizeVals = '2xs' | 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl';
3 | export declare type LineHeights = 'none' | 'tight' | 'snug' | 'normal' | 'relaxed' | 'loose';
4 | export declare type LetterSpacing = 'tight' | 'normal' | 'wide';
5 | export declare type ParagraphSizes = 'paragraph-leading' | 'paragraph' | 'paragraph-small' | 'paragraph-tiny';
6 | export declare type FontFamilyVals = 'ui' | 'prose' | 'mono';
7 | export declare type FontWeightVals = 'normal' | 'light' | 'medium' | 'semibold' | 'bold';
8 | export declare type FontStyleVals = 'italic' | 'non-italic';
9 | export declare type TextAlign = 'left' | 'center' | 'right' | 'justify';
10 | export declare type TextDecoration = 'underline' | 'line-through' | 'no-underline';
11 | export declare type TextTransform = 'uppercase' | 'lowercase' | 'capitalize' | 'normal-case';
12 | export declare type TextOverflow = 'truncate' | 'overflow-ellipsis' | 'overflow-clip';
13 | export declare type VerticalAlign = 'baseline' | 'top' | 'middle' | 'bottom' | 'text-top' | 'text-bottom';
14 | export declare type Whitespace = 'normal' | 'nowrap' | 'pre' | 'pre-line' | 'pre-wrap';
15 | export declare type WordBreak = 'normal' | 'words' | 'all';
16 | export interface ITypographyProps {
17 | fontSize?: FontSizeVals | ParagraphSizes;
18 | lineHeight?: LineHeights | ParagraphSizes;
19 | letterSpacing?: LetterSpacing;
20 | fontFamily?: FontFamilyVals;
21 | fontWeight?: FontWeightVals;
22 | fontStyle?: FontStyleVals;
23 | textAlign?: TextAlign;
24 | textDecoration?: TextDecoration;
25 | textTransform?: TextTransform;
26 | textOverflow?: TextOverflow;
27 | verticalAlign?: VerticalAlign;
28 | whitespace?: Whitespace;
29 | wordBreak?: WordBreak;
30 | }
31 | export declare const typographyPropNames: Array;
32 | export declare const typographyProps: EnhancerFn;
33 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/components/Panel/Panel.d.ts:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { PolymorphicComponentProps } from '../Box';
3 | export declare type PanelOwnProps = {
4 | /**
5 | * The contents of the panel.
6 | *
7 | * A Panel.Titlebar must be the first child element.
8 | */
9 | children: React.ReactNode;
10 | /**
11 | * Wether the panel should be rounded. Applies rounded "lg" and overflow hidden.
12 | *
13 | * Usually only use this on root panel components, not nested panel components.
14 | */
15 | rounded?: boolean;
16 | /**
17 | * Controls how the panel will appear.
18 | *
19 | * @default 'default'
20 | */
21 | appearance?: 'default' | 'minimal';
22 | /**
23 | * Enable collapsing
24 | */
25 | isCollapsible?: boolean;
26 | /**
27 | * Identifier to use for aria controls when collapse is enabled
28 | */
29 | id?: string;
30 | /**
31 | * Controls whether to show the panel contents or not by default in.
32 | *
33 | * If defaultIsOpen is provided the panel will be uncontrolled.
34 | */
35 | defaultIsOpen?: boolean;
36 | /**
37 | * Controls whether to show the panel contents or not.
38 | *
39 | * If no onChange is provided, isOpen will be used as the default value (uncontrolled).
40 | */
41 | isOpen?: boolean;
42 | /**
43 | * Called when the collapsed state changes.
44 | *
45 | * When not provided, the component will control it's own state internally (uncontrolled).
46 | */
47 | onChange?: (value: boolean) => void;
48 | };
49 | export declare type PanelProps = PolymorphicComponentProps<'div', PanelOwnProps>;
50 | export declare const Panel: {
51 | ({ appearance, id, className, children, isCollapsible, isOpen: isOpenProp, defaultIsOpen, onChange, rounded, ...extraProps }: PanelProps): JSX.Element;
52 | Titlebar: React.NamedExoticComponent;
53 | Content: React.FC>>;
54 | };
55 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/components/Menu/MenuItem.d.ts:
--------------------------------------------------------------------------------
1 | import React, { ReactNode } from 'react';
2 | export declare type MenuItemProps = {
3 | /**
4 | * The text to display in the menu item.
5 | */
6 | text: ReactNode;
7 | /**
8 | * Optional element to render on the right side of the menu item. Use this to display keyboard shortcut, badge counts, etc.
9 | */
10 | meta?: ReactNode;
11 | /**
12 | * Render menu item with extra space on the left side. Useful to align menus when some items are checkbox items.
13 | */
14 | indent?: boolean;
15 | /**
16 | * If true or false is provided, menu item will render with indent={true}, and a checkbox icon when true.
17 | */
18 | checked?: boolean;
19 | /**
20 | * If provided, the menu item will render as a link with target="_blank". href must be an absolute url.
21 | */
22 | href?: string;
23 | /**
24 | * When disabled is true the MenuItem is rendered as semi-transparent and cannot be interacted with.
25 | */
26 | disabled?: boolean;
27 | /**
28 | * Optional additional logic to run when MenuItem is clicked (or triggered in any way, such as via keyboard shortcut).
29 | */
30 | onClick?: (event: React.MouseEvent) => void;
31 | /**
32 | * For use when nesting menus, if you want the submenu to have a particular label. Gets forwarded through to the `Menu.label` prop.
33 | */
34 | label?: string;
35 | /**
36 | * If children are supplied then this MenuItem will render a submenu when active. Must contain `MenuItem`, `MenuDivider`, or `MenuRadioGroup` components.
37 | */
38 | children?: React.ReactNode;
39 | /**
40 | * Not for external use, this property is used by the Menu component when rendering submenus.
41 | *
42 | * @private
43 | */
44 | __hasSubmenu?: boolean;
45 | /**
46 | * Not for external use, this property is used by the menu component when rendering items.
47 | *
48 | * @private
49 | */
50 | __active?: boolean;
51 | };
52 | export declare const MenuItem: React.ForwardRefExoticComponent>;
53 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/components/Tooltip/Tooltip.d.ts:
--------------------------------------------------------------------------------
1 | import { MutableRefObject, ReactElement } from 'react';
2 | import { MaybeRenderProp, Placement } from '../../utils';
3 | /**
4 | * Expose a select set of props to customize the popover wrapper
5 | */
6 | declare type TooltipBoxProps = {};
7 | export declare type TooltipProps = {
8 | /**
9 | * The element that will trigger the Tooltip. Should be a button in most cases. Can use a function for more control.
10 | */
11 | renderTrigger: MaybeRenderProp<{
12 | isOpen: boolean;
13 | }, ReactElement>;
14 | /**
15 | * The content to render in the Tooltip. Can use a function to access Tooltip state and for more control over close.
16 | */
17 | children: MaybeRenderProp<{
18 | close: () => void;
19 | }>;
20 | /**
21 | * The ref of the element the Tooltip should visually attach itself to.
22 | */
23 | triggerRef?: MutableRefObject;
24 | /**
25 | * The delay time for the tooltip to show up, in milliseconds. Defaults to 500.
26 | */
27 | delay?: number;
28 | /**
29 | * Whether the tooltip should be disabled, independent from the trigger.
30 | */
31 | isDisabled?: boolean;
32 | /**
33 | * Whether the Tooltip is open (controlled mode).
34 | */
35 | isOpen?: boolean;
36 | /**
37 | * Wether to default the Tooltip to open (uncontrolled mode).
38 | */
39 | defaultOpen?: boolean;
40 | /**
41 | * Called when the Tooltip opens.
42 | */
43 | onOpen?: () => void;
44 | /**
45 | * Called when the Tooltip closes.
46 | */
47 | onClose?: () => void;
48 | /**
49 | * The placement of the Tooltip overlay with respect to its trigger element. Defaults to `bottom`.
50 | */
51 | placement?: Placement;
52 | /**
53 | * Whether the element should flip its orientation (e.g. top to bottom or left to right) when there is insufficient
54 | * room for it to render completely. Defaults to true.
55 | */
56 | shouldFlip?: boolean;
57 | /**
58 | * The additional offset applied along the main axis between the element and its anchor element.
59 | */
60 | offset?: number;
61 | /**
62 | * The additional offset applied along the cross axis between the element and its anchor element.
63 | */
64 | crossOffset?: number;
65 | /**
66 | * Pass true to render the tooltip without an arrow.
67 | */
68 | hideArrow?: boolean;
69 | } & TooltipBoxProps;
70 | export declare const Tooltip: (props: TooltipProps) => JSX.Element;
71 | export {};
72 |
--------------------------------------------------------------------------------
/pages/docs/[projectSlug]/[[...docsPath]].tsx:
--------------------------------------------------------------------------------
1 | import { Box } from '@stoplight/mosaic';
2 | import { GetStaticPaths, GetStaticProps, InferGetStaticPropsType } from 'next';
3 | import dynamic from 'next/dynamic';
4 | import { useRouter } from 'next/router';
5 | import * as React from 'react';
6 |
7 | import { ErrorBoundary } from '../../../components/ErrorBoundary';
8 | import { PageTransition } from '../../../components/PageTransition';
9 | import { fetchNode } from '../../../handlers/node';
10 | import { getLayout } from '../../../layouts/StoplightProjectLayout';
11 |
12 | // @ts-expect-error : TODO need to fix the typings or wrap + re-export this component
13 | const DocsContent = dynamic(() => import('@stoplight/elements/components/Docs').then(mod => mod.Docs), { ssr: false });
14 |
15 | type ThenArg = T extends PromiseLike ? U : T;
16 |
17 | export const getStaticProps: GetStaticProps<{
18 | node: ThenArg>;
19 | }> = async ctx => {
20 | const { docsPath, projectSlug } = ctx.params;
21 |
22 | let node;
23 | try {
24 | node = await fetchNode({
25 | projectSlug: typeof projectSlug === 'string' ? projectSlug : projectSlug.join('/'),
26 | nodeUri: typeof docsPath === 'string' ? docsPath : docsPath.join('/'),
27 | });
28 | } catch (e) {
29 | // TODO: throw error with a code so we can distinguish not found from other errors
30 | console.error('docs.fetchNode.getStaticProps', e);
31 | return {
32 | notFound: true,
33 | };
34 | }
35 |
36 | return {
37 | // 1 min
38 | revalidate: 60,
39 | props: {
40 | node,
41 | },
42 | };
43 | };
44 |
45 | export const getStaticPaths: GetStaticPaths = async () => {
46 | return {
47 | paths: [],
48 | // this generates static pages on demand, with re-build according to `revalidate` seconds prop above
49 | fallback: 'blocking',
50 | };
51 | };
52 |
53 | function DocsPage({ node }: InferGetStaticPropsType) {
54 | React.useEffect(() => console.info('DocsPage.mount'), []);
55 | console.info('DocsPage.render');
56 |
57 | const router = useRouter();
58 | if (router.isFallback) {
59 | return Loading...
;
60 | }
61 |
62 | let elem;
63 | if (!node || router.isFallback) {
64 | elem = Loading... ;
65 | } else {
66 | elem = (
67 |
68 | {/* @ts-expect-error : TODO let's make nodeType have a less strict typing (no enums) */}
69 |
70 |
71 | );
72 | }
73 |
74 | return (
75 |
76 | {elem}
77 |
78 | );
79 | }
80 |
81 | DocsPage.getLayout = getLayout;
82 |
83 | export default DocsPage;
84 |
--------------------------------------------------------------------------------
/components/StoplightProjectSidebar.tsx:
--------------------------------------------------------------------------------
1 | import { TableOfContentsSkeleton } from '@stoplight/elements/components/TableOfContents/Skeleton';
2 | import { usePlatformApi } from '@stoplight/elements/hooks/usePlatformApi';
3 | import { useTocContents } from '@stoplight/elements/hooks/useTocContents';
4 | import { ITableOfContentsTree, TableOfContentsLinkWithId } from '@stoplight/elements/types';
5 | import { Box } from '@stoplight/mosaic';
6 | import { DefaultRow, RowComponentType, TableOfContents as UIKitTableOfContents } from '@stoplight/ui-kit';
7 | import Link from 'next/link';
8 | import * as path from 'path';
9 | import * as React from 'react';
10 |
11 | import { usePrefetchOnHover } from '../hooks/usePrefetchOnHover';
12 |
13 | const tocUri = 'api/v1/projects/{workspaceSlug}/{projectSlug}/table-of-contents';
14 |
15 | export type StoplightProjectSidebarProps = {
16 | projectSlug: string;
17 | nodeUri?: string;
18 | branchSlug?: string;
19 | };
20 |
21 | export const StoplightProjectSidebar = React.memo(
22 | ({ projectSlug, branchSlug, nodeUri }) => {
23 | const { data: tocData, error } = usePlatformApi(
24 | tocUri,
25 | {
26 | workspaceSlug: 'meta',
27 | projectSlug,
28 | branchSlug,
29 | },
30 | {
31 | type: 'custom',
32 | },
33 | );
34 |
35 | const tree = tocData ?? { items: [] };
36 |
37 | const contents: TableOfContentsLinkWithId[] = useTocContents(tree).map(item => {
38 | return {
39 | ...item,
40 | isActive: item.type === 'item' && nodeUri !== void 0 ? item.to === nodeUri : false,
41 | };
42 | });
43 |
44 | if (!tocData && !error) {
45 | return ;
46 | }
47 |
48 | return (
49 |
58 | );
59 | },
60 | );
61 |
62 | const StoplightProjectSidebarRow: RowComponentType<
63 | TableOfContentsLinkWithId,
64 | { projectSlug: string; nodeUri?: string }
65 | > = ({ item, extra, ...rest }) => {
66 | const { projectSlug, nodeUri } = extra;
67 |
68 | const to = path.join('/docs', projectSlug, item.to || '');
69 | const prefetchProps = usePrefetchOnHover(to);
70 |
71 | if (!item.to) return ;
72 | if (item.isExternalLink) {
73 | return (
74 |
75 |
76 |
77 | );
78 | }
79 |
80 | const isSelected = item.to === nodeUri;
81 |
82 | // TODO: no-underline isn't working because Elements overrides with an a:hover style
83 | return (
84 |
85 |
86 |
94 |
95 |
96 | );
97 | };
98 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/components/Select/types.d.ts:
--------------------------------------------------------------------------------
1 | import { AriaButtonProps } from '@react-types/button';
2 | import { AriaLabelingProps, CollectionChildren, ItemElement, ItemRenderer } from '@react-types/shared';
3 | import { Key, ReactElement, ReactNode } from 'react';
4 | import { FlexGrowVals, WidthVals } from '../../enhancers';
5 | import { FieldButtonProps } from '../Button';
6 | export declare type SelectProps = AriaLabelingProps & {
7 | /**
8 | * The contents of the Select collection.
9 | */
10 | children: CollectionChildren;
11 | /**
12 | * Item objects in the collection. Must be provided when rendering dynamic children.
13 | */
14 | items?: Iterable;
15 | /**
16 | * The name of the Select input, used when submitting an HTML form.
17 | */
18 | name?: string;
19 | /**
20 | * TODO: The content to display as the label. Use aria-label if a visible label is not desired.
21 | */
22 | label?: React.ReactNode;
23 | /**
24 | * Temporary text that occupies the text input when it is empty.
25 | */
26 | placeholder?: string;
27 | /**
28 | * The select button size - defaults to 'md'.
29 | */
30 | size?: 'sm' | 'md';
31 | /**
32 | * A function that returns the element that will trigger the Select. Should be a FieldButton in most cases.
33 | */
34 | renderTrigger?: (props: Pick & AriaButtonProps<'button'>, state: {
35 | selectedItem?: SelectOptionProps;
36 | }) => ReactElement;
37 | /**
38 | * Optional text to render in front of the trigger text. Is only included when a value is selected - placeholder is not affected.
39 | */
40 | triggerTextPrefix?: string;
41 | /**
42 | * When true the end user can select the currently selected option to de-select it (and thus clear back to empty value).
43 | */
44 | allowEmptySelection?: boolean;
45 | /**
46 | * Whether the input can be selected but not changed by the user.
47 | */
48 | isReadOnly?: boolean;
49 | /**
50 | * Whether the Select is disabled.
51 | */
52 | isDisabled?: boolean;
53 | /**
54 | * The currently selected value in the collection (controlled).
55 | */
56 | selectedValue?: Key;
57 | /**
58 | * The initial selected value in the collection (uncontrolled).
59 | */
60 | defaultSelectedValue?: Key;
61 | /**
62 | * Handler that is called when the selection changes.
63 | */
64 | onSelectionChange?: (value: Key) => void;
65 | /**
66 | * The values that are disabled. These options cannot be selected, focused, or otherwise interacted with.
67 | */
68 | disabledValues?: Iterable;
69 | /**
70 | * Called when the Select opens.
71 | */
72 | onOpen?: () => void;
73 | /**
74 | * Called when the Select closes.
75 | */
76 | onClose?: () => void;
77 | flexGrow?: FlexGrowVals;
78 | w?: WidthVals;
79 | };
80 | export declare type SelectItem = SelectOptionProps | SelectActionProps;
81 | declare type SelectItemBase = {
82 | /**
83 | * Optional element to render on the right side of the menu item. Use this to display keyboard shortcut, badge counts, etc.
84 | */
85 | meta?: ReactNode;
86 | };
87 | export declare type SelectOptionProps = SelectItemBase & {
88 | value: Key;
89 | text?: String;
90 | };
91 | export declare type SelectActionProps = SelectItemBase & {
92 | text: String;
93 | /**
94 | * Called when SelectOption is clicked (or triggered in any way, such as via keyboard shortcut).
95 | */
96 | onPress: () => void;
97 | };
98 | export interface SelectSectionProps {
99 | /** Rendered contents of the section, e.g. a header. */
100 | title?: ReactNode;
101 | /** An accessibility label for the section. */
102 | 'aria-label'?: string;
103 | /** Static child items or a function to render children. */
104 | children: ItemElement | ItemElement[] | ItemRenderer;
105 | /** Item objects in the section. */
106 | items?: Iterable;
107 | }
108 | export {};
109 |
--------------------------------------------------------------------------------
/components/NextNProgress.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Adapted from https://github.com/apal21/nextjs-progressbar/blob/master/src/index.js
3 | *
4 | * Adds startDelayMs
5 | */
6 |
7 | import Router from 'next/router';
8 | import NProgress from 'nprogress';
9 | import * as React from 'react';
10 |
11 | export interface INextNProgressProps {
12 | color: string;
13 | height?: number;
14 | startPosition?: number;
15 | startDelayMs?: number;
16 | stopDelayMs?: number;
17 | options?: object;
18 | }
19 |
20 | export class NextNProgress extends React.Component {
21 | static defaultProps = {
22 | color: '#29D',
23 | startPosition: 0.3,
24 | startDelayMs: 0,
25 | stopDelayMs: 200,
26 | height: 3,
27 | };
28 |
29 | started = false;
30 | startTimer: NodeJS.Timeout | null = null;
31 | endTimer: NodeJS.Timeout | null = null;
32 |
33 | routeChangeStart = () => {
34 | if (this.startTimer) clearTimeout(this.startTimer);
35 | if (this.endTimer) clearTimeout(this.endTimer);
36 | this.startTimer = setTimeout(() => {
37 | this.started = true;
38 | NProgress.set(this.props.startPosition || 0);
39 | NProgress.start();
40 | }, this.props.startDelayMs);
41 | };
42 |
43 | routeChangeEnd = () => {
44 | clearTimeout(this.startTimer);
45 | clearTimeout(this.endTimer);
46 | if (!this.started) return;
47 | this.started = false;
48 | this.endTimer = setTimeout(() => {
49 | NProgress.done(true);
50 | }, this.props.stopDelayMs);
51 | };
52 |
53 | render() {
54 | const { color, height } = this.props;
55 |
56 | return (
57 |
125 | );
126 | }
127 |
128 | componentDidMount() {
129 | const { options } = this.props;
130 |
131 | if (options) {
132 | NProgress.configure(options);
133 | }
134 |
135 | Router.events.on('routeChangeStart', this.routeChangeStart);
136 | Router.events.on('routeChangeComplete', this.routeChangeEnd);
137 | Router.events.on('routeChangeError', this.routeChangeEnd);
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/components/Popover/Popover.d.ts:
--------------------------------------------------------------------------------
1 | import React, { ReactElement, RefObject } from 'react';
2 | import { MaybeRenderProp, Placement } from '../../utils';
3 | import { BoxOwnProps } from '../Box';
4 | /**
5 | * Expose a select set of props to customize the popover wrapper
6 | */
7 | declare type PopoverBoxProps = Pick;
8 | export declare type PopoverProps = {
9 | /**
10 | * The element that will trigger the Popover. Should be a button in most cases. Can use a function for more control.
11 | */
12 | renderTrigger: MaybeRenderProp<{
13 | isOpen: boolean;
14 | }, ReactElement>;
15 | /**
16 | * The content to render in the Popover. Can use a function to access Popover state and for more control over close.
17 | */
18 | children: MaybeRenderProp<{
19 | close: () => void;
20 | }>;
21 | /**
22 | * The ref of the element the Popover should visually attach itself to.
23 | */
24 | triggerRef?: RefObject;
25 | scrollRef?: RefObject;
26 | /**
27 | * Whether the Popover is open (controlled mode).
28 | */
29 | isOpen?: boolean;
30 | /**
31 | * Wether to default the Popover to open (uncontrolled mode).
32 | */
33 | defaultOpen?: boolean;
34 | /**
35 | * Called when the Popover opens.
36 | */
37 | onOpen?: () => void;
38 | /**
39 | * Called when the Popover closes.
40 | */
41 | onClose?: () => void;
42 | /**
43 | * The placement of the Popover overlay with respect to its trigger element.
44 | */
45 | placement?: Placement;
46 | /**
47 | * Whether the element should flip its orientation (e.g. top to bottom or left to right) when there is insufficient
48 | * room for it to render completely. Defaults to true.
49 | */
50 | shouldFlip?: boolean;
51 | /**
52 | * The additional offset applied along the main axis between the element and its anchor element.
53 | */
54 | offset?: number;
55 | /**
56 | * The additional offset applied along the cross axis between the element and its anchor element.
57 | */
58 | crossOffset?: number;
59 | } & PopoverBoxProps;
60 | export declare const Popover: React.ForwardRefExoticComponent<{
61 | /**
62 | * The element that will trigger the Popover. Should be a button in most cases. Can use a function for more control.
63 | */
64 | renderTrigger: MaybeRenderProp<{
65 | isOpen: boolean;
66 | }, ReactElement>;
67 | /**
68 | * The content to render in the Popover. Can use a function to access Popover state and for more control over close.
69 | */
70 | children: MaybeRenderProp<{
71 | close: () => void;
72 | }>;
73 | /**
74 | * The ref of the element the Popover should visually attach itself to.
75 | */
76 | triggerRef?: RefObject;
77 | scrollRef?: RefObject;
78 | /**
79 | * Whether the Popover is open (controlled mode).
80 | */
81 | isOpen?: boolean;
82 | /**
83 | * Wether to default the Popover to open (uncontrolled mode).
84 | */
85 | defaultOpen?: boolean;
86 | /**
87 | * Called when the Popover opens.
88 | */
89 | onOpen?: () => void;
90 | /**
91 | * Called when the Popover closes.
92 | */
93 | onClose?: () => void;
94 | /**
95 | * The placement of the Popover overlay with respect to its trigger element.
96 | */
97 | placement?: Placement;
98 | /**
99 | * Whether the element should flip its orientation (e.g. top to bottom or left to right) when there is insufficient
100 | * room for it to render completely. Defaults to true.
101 | */
102 | shouldFlip?: boolean;
103 | /**
104 | * The additional offset applied along the main axis between the element and its anchor element.
105 | */
106 | offset?: number;
107 | /**
108 | * The additional offset applied along the cross axis between the element and its anchor element.
109 | */
110 | crossOffset?: number;
111 | } & Pick>, "p"> & React.RefAttributes>;
112 | export {};
113 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/components/Tabs/TabsContext.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { TabsOwnProps } from './Tabs';
3 | export declare const TabsContext: React.Context void;
22 | unregisterItem: (id: string) => void;
23 | registerGroup: (group: import("reakit/ts/Composite/__utils/types").Group) => void;
24 | unregisterGroup: (id: string) => void;
25 | move: (id: string) => void;
26 | next: (unstable_allTheWay?: boolean) => void;
27 | previous: (unstable_allTheWay?: boolean) => void;
28 | up: (unstable_allTheWay?: boolean) => void;
29 | down: (unstable_allTheWay?: boolean) => void;
30 | first: () => void;
31 | last: () => void;
32 | sort: () => void;
33 | unstable_setVirtual: React.Dispatch>;
34 | setRTL: React.Dispatch>;
35 | setOrientation: React.Dispatch>;
36 | setCurrentId: React.Dispatch>;
37 | setLoop: React.Dispatch>;
38 | setWrap: React.Dispatch>;
39 | setShift: React.Dispatch>;
40 | reset: () => void;
41 | unstable_setIncludesBaseElement: React.Dispatch>;
42 | unstable_setHasActiveWidget: React.Dispatch>;
43 | } & {
44 | select: (id: string) => void;
45 | setSelectedId: React.Dispatch>;
46 | registerPanel: (item: import("reakit/ts/Composite/__utils/types").Item) => void;
47 | unregisterPanel: (id: string) => void;
48 | } & Pick>;
49 | export declare const useTabContext: () => import("reakit/ts").unstable_IdState & {
50 | unstable_virtual: boolean;
51 | rtl: boolean;
52 | orientation?: import("reakit/ts/Composite/__utils/types").Orientation;
53 | items: import("reakit/ts/Composite/__utils/types").Item[];
54 | groups: import("reakit/ts/Composite/__utils/types").Group[];
55 | currentId?: string;
56 | loop: boolean | "horizontal" | "vertical";
57 | wrap: boolean | "horizontal" | "vertical";
58 | shift: boolean;
59 | unstable_moves: number;
60 | unstable_hasActiveWidget: boolean;
61 | unstable_includesBaseElement: boolean;
62 | } & {
63 | selectedId?: string;
64 | panels: import("reakit/ts/Composite/__utils/types").Item[];
65 | manual: boolean;
66 | } & import("reakit/ts").unstable_IdActions & {
67 | registerItem: (item: import("reakit/ts/Composite/__utils/types").Item) => void;
68 | unregisterItem: (id: string) => void;
69 | registerGroup: (group: import("reakit/ts/Composite/__utils/types").Group) => void;
70 | unregisterGroup: (id: string) => void;
71 | move: (id: string) => void;
72 | next: (unstable_allTheWay?: boolean) => void;
73 | previous: (unstable_allTheWay?: boolean) => void;
74 | up: (unstable_allTheWay?: boolean) => void;
75 | down: (unstable_allTheWay?: boolean) => void;
76 | first: () => void;
77 | last: () => void;
78 | sort: () => void;
79 | unstable_setVirtual: React.Dispatch>;
80 | setRTL: React.Dispatch>;
81 | setOrientation: React.Dispatch>;
82 | setCurrentId: React.Dispatch>;
83 | setLoop: React.Dispatch>;
84 | setWrap: React.Dispatch>;
85 | setShift: React.Dispatch>;
86 | reset: () => void;
87 | unstable_setIncludesBaseElement: React.Dispatch>;
88 | unstable_setHasActiveWidget: React.Dispatch>;
89 | } & {
90 | select: (id: string) => void;
91 | setSelectedId: React.Dispatch>;
92 | registerPanel: (item: import("reakit/ts/Composite/__utils/types").Item) => void;
93 | unregisterPanel: (id: string) => void;
94 | } & Pick;
95 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/components/LinkHeading/LinkHeading.d.ts:
--------------------------------------------------------------------------------
1 | import './style.css';
2 | import React from 'react';
3 | import { BoxProps } from '../Box';
4 | import { HeadingAs, HeadingOwnProps } from '../Heading';
5 | export declare type LinkHeadingOwnProps = HeadingOwnProps & {
6 | id?: string;
7 | };
8 | export declare type LinkHeadingProps = LinkHeadingOwnProps & BoxProps;
9 | export declare const LinkHeading: React.MemoExoticComponent & React.RefAttributes>>;
10 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/components/Heading/Heading.d.ts:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { BoxProps } from '../Box/types';
3 | export declare type HeadingSizeVals = 1 | 2 | 3 | 4;
4 | export declare type HeadingOwnProps = {
5 | size: HeadingSizeVals;
6 | };
7 | export declare type HeadingAs = 'h1' | 'h2' | 'h3' | 'h4';
8 | export declare type HeadingProps = HeadingOwnProps & BoxProps;
9 | export declare const Heading: React.MemoExoticComponent & React.RefAttributes>>;
10 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/components/Button/FieldButton.d.ts:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { ButtonProps } from './Button';
3 | export declare type FieldButtonProps = {
4 | placeholder?: string;
5 | onClear?: () => void;
6 | } & ButtonProps;
7 | export declare const FieldButton: React.ForwardRefExoticComponent & React.RefAttributes>;
8 |
--------------------------------------------------------------------------------
/components/SiteHeader.tsx:
--------------------------------------------------------------------------------
1 | import { Box, Container, Flex, HStack, Icon, Menu, MenuItem, NoSsr, Pressable } from '@stoplight/mosaic';
2 | import Link from 'next/link';
3 | import { useRouter } from 'next/router';
4 | import * as React from 'react';
5 |
6 | import { usePrefetchOnHover } from '../hooks';
7 | import { ThemeSwitcher } from './ThemeSwitcher';
8 |
9 | const SiteHeaderLink = ({ to, children }: { to: string; children: React.ReactNode }) => {
10 | const router = useRouter();
11 |
12 | const currentPath = router.asPath;
13 | const isActive = currentPath === to || currentPath.startsWith(to);
14 |
15 | return (
16 |
17 |
18 |
24 | {children}
25 |
26 |
27 |
28 | );
29 | };
30 |
31 | const SiteHeaderMenuLink = ({ to, children }: { to: string; children: React.ReactNode }) => {
32 | const router = useRouter();
33 |
34 | const currentPath = router.asPath;
35 | const isActive = currentPath === to || currentPath.startsWith(to);
36 |
37 | return (
38 |
39 |
47 | {children}
48 |
49 |
50 | );
51 | };
52 |
53 | const SiteHeader = React.memo(() => {
54 | // mosaic doesn't yet support `fak` (custom kit icons)
55 | // @ts-expect-error
56 | const icon = ;
57 | const router = useRouter();
58 |
59 | console.info('SiteHeader.render');
60 |
61 | return (
62 |
63 |
64 |
65 |
66 |
67 |
68 | {icon}
69 |
70 |
71 |
72 |
73 |
74 | Docs
75 | Guides
76 |
77 |
81 |
82 | Reference
83 |
84 |
85 | }
86 | >
87 | Styleguides with Spectral}
89 | onClick={() => {
90 | // TODO: This is a hack because the text prop doesn't allow filling the entire row. This there's a space to the right that's unclickable by the link
91 | router.push('/docs/spectral/README.md');
92 | }}
93 | />
94 |
95 | Mock with Prism}
97 | onClick={() => {
98 | // TODO: This is a hack because the text prop doesn't allow filling the entire row. This there's a space to the right that's unclickable by the link
99 | router.push('/docs/prism/README.md');
100 | }}
101 | />
102 |
103 | Docs with Elements
106 | }
107 | onClick={() => {
108 | // TODO: This is a hack because the text prop doesn't allow filling the entire row. This there's a space to the right that's unclickable by the link
109 | router.push('/docs/elements/docs/introduction.md');
110 | }}
111 | />
112 |
113 | Stoplight CLI}
115 | onClick={() => {
116 | // TODO: This is a hack because the text prop doesn't allow filling the entire row. This there's a space to the right that's unclickable by the link
117 | router.push('/docs/cli/README.md');
118 | }}
119 | />
120 |
121 | Stoplight API}
123 | onClick={() => {
124 | // TODO: This is a hack because the text prop doesn't allow filling the entire row. This there's a space to the right that's unclickable by the link
125 | router.push('/docs/platform-api/openapi.v1.yaml');
126 | }}
127 | />
128 |
129 |
130 |
131 |
132 |
133 | Blog
134 | Support
135 | Sign In
136 |
137 |
138 |
139 |
140 |
141 |
142 | );
143 | });
144 |
145 | export default SiteHeader;
146 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/components/Input/Input.d.ts:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { IMarginProps, IntentVals } from '../../enhancers';
3 | import { BoxOwnProps } from '../Box/types';
4 | import { IIconProps } from '../Icon';
5 | import { AppearanceVals } from './variants';
6 | export interface IInputProps extends IMarginProps, BoxOwnProps>, Omit, HTMLInputElement>, 'width' | 'height' | 'color' | 'size'> {
7 | appearance?: AppearanceVals;
8 | intent?: IntentVals;
9 | size?: 'sm' | 'md' | 'lg';
10 | disabled?: boolean;
11 | readOnly?: boolean;
12 | required?: boolean;
13 | icon?: IIconProps['icon'] | React.ReactElement;
14 | }
15 | export declare const Input: React.MemoExoticComponent & React.RefAttributes>>;
16 |
--------------------------------------------------------------------------------
/.yalc/@stoplight/mosaic/themes/default.css:
--------------------------------------------------------------------------------
1 | :root,
2 | [data-theme="light"],
3 | [data-theme="light"] .sl-inverted .sl-inverted,
4 | [data-theme="light"] .sl-inverted .sl-inverted .sl-inverted .sl-inverted {
5 | color: var(--color-text);
6 |
7 | --text-h: 0;
8 | --text-s: 0%;
9 | --text-l: 15%;
10 | --shadow-sm: 0px 0px 1px rgba(67, 90, 111, 0.3);
11 | --shadow-md: 0px 2px 4px -2px rgba(0, 0, 0, 0.25), 0px 0px 1px rgba(67, 90, 111, 0.3);
12 | --shadow-lg: 0 5px 14px -3px rgba(67, 90, 111, .3), 0 0 0 0.5px rgba(0,0,0,.2);
13 | --shadow-xl: 0px 0px 1px rgba(67, 90, 111, 0.3), 0px 8px 10px -4px rgba(67, 90, 111, 0.45);
14 | --shadow-2xl: 0px 0px 1px rgba(67, 90, 111, 0.3), 0px 16px 24px -8px rgba(67, 90, 111, 0.45);
15 | --color-text-heading: hsla(var(--text-h), var(--text-s), max(3, calc(var(--text-l) - 10)), 1);
16 | --color-text: hsla(var(--text-h), var(--text-s), var(--text-l), 1);
17 | --color-text-paragraph: hsla(var(--text-h), var(--text-s), var(--text-l), 0.9);
18 | --color-text-muted: hsla(var(--text-h), var(--text-s), var(--text-l), 0.7);
19 | --color-text-light: hsla(var(--text-h), var(--text-s), var(--text-l), 0.55);
20 | --canvas-h: 218;
21 | --canvas-s: 40%;
22 | --canvas-l: 100%;
23 | --color-canvas: hsla(var(--canvas-h), var(--canvas-s), var(--canvas-l), 1);
24 | --color-canvas-pure: hsla(218, 40%, 100%, 1);
25 | --color-canvas-50: hsla(218, 40%, 88%, 0.15);
26 | --color-canvas-100: hsla(218, 30%, 96%, 1);
27 | --color-canvas-200: hsla(218, 36%, 92%, 1);
28 | --color-canvas-300: hsla(218, 38%, 89%, 1);
29 | --color-canvas-dialog: hsla(218, 40%, 100%, 1);
30 | --color-border-dark: hsla(var(--canvas-h), 30%, 72%, 0.5);
31 | --color-border: hsla(var(--canvas-h), 32%, 78%, 0.5);
32 | --color-border-light: hsla(var(--canvas-h), 24%, 84%, 0.5);
33 | --color-border-input: hsla(var(--canvas-h), 24%, 72%, 0.8);
34 | --color-border-button: hsla(var(--canvas-h), 24%, 20%, 0.8);
35 | --primary-h: 211;
36 | --primary-s: 100%;
37 | --primary-l: 61%;
38 | --color-text-primary: hsla(211, 100%, 40%, 1);
39 | --color-primary-dark: hsla(211, 80%, 52%, 1);
40 | --color-primary: hsla(211, 100%, 61%, 1);
41 | --color-primary-light: hsla(211, 100%, 73%, 1);
42 | --color-primary-tint: hsla(211, 100%, 65%, 0.25);
43 | --color-on-primary: hsla(211, 100%, 100%, 1);
44 | --success-h: 160;
45 | --success-s: 84%;
46 | --success-l: 34%;
47 | --color-text-success: hsla(160, 84%, 40%, 1);
48 | --color-success-dark: hsla(160, 67%, 29%, 1);
49 | --color-success: hsla(160, 84%, 34%, 1);
50 | --color-success-light: hsla(160, 84%, 41%, 1);
51 | --color-success-tint: hsla(160, 84%, 65%, 0.25);
52 | --color-on-success: hsla(160, 84%, 100%, 1);
53 | --warning-h: 20;
54 | --warning-s: 90%;
55 | --warning-l: 56%;
56 | --color-text-warning: hsla(20, 90%, 40%, 1);
57 | --color-warning-dark: hsla(20, 72%, 48%, 1);
58 | --color-warning: hsla(20, 90%, 56%, 1);
59 | --color-warning-light: hsla(20, 90%, 67%, 1);
60 | --color-warning-tint: hsla(20, 90%, 65%, 0.25);
61 | --color-on-warning: hsla(20, 90%, 100%, 1);
62 | --danger-h: 0;
63 | --danger-s: 84%;
64 | --danger-l: 63%;
65 | --color-text-danger: hsla(0, 84%, 40%, 1);
66 | --color-danger-dark: hsla(0, 67%, 54%, 1);
67 | --color-danger: hsla(0, 84%, 63%, 1);
68 | --color-danger-light: hsla(0, 84%, 76%, 1);
69 | --color-danger-tint: hsla(0, 84%, 65%, 0.25);
70 | --color-on-danger: hsla(0, 84%, 100%, 1);
71 |
72 | }
73 |
74 | [data-theme="light"] .sl-inverted,
75 | [data-theme="light"] .sl-inverted .sl-inverted .sl-inverted {
76 | color: var(--color-text);
77 |
78 | --text-h: 0;
79 | --text-s: 0%;
80 | --text-l: 98%;
81 | --shadow-sm: 0px 0px 1px rgba(11, 13, 19, 0.5);
82 | --shadow-md: 0px 2px 4px -2px rgba(0, 0, 0, 0.35), 0px 0px 1px rgba(11, 13, 19, 0.4);
83 | --shadow-lg: 0 2px 14px rgba(0,0,0,.55), 0 0 0 0.5px rgba(255,255,255,.3);
84 | --shadow-xl: 0px 0px 1px rgba(11, 13, 19, 0.4), 0px 8px 10px -4px rgba(11, 13, 19, 0.55);
85 | --shadow-2xl: 0px 0px 1px rgba(11, 13, 19, 0.4), 0px 16px 24px -8px rgba(11, 13, 19, 0.55);
86 | --color-text-heading: hsla(var(--text-h), var(--text-s), max(3, calc(var(--text-l) - 10)), 1);
87 | --color-text: hsla(var(--text-h), var(--text-s), var(--text-l), 1);
88 | --color-text-paragraph: hsla(var(--text-h), var(--text-s), var(--text-l), 0.9);
89 | --color-text-muted: hsla(var(--text-h), var(--text-s), var(--text-l), 0.7);
90 | --color-text-light: hsla(var(--text-h), var(--text-s), var(--text-l), 0.55);
91 | --canvas-h: 218;
92 | --canvas-s: 28%;
93 | --canvas-l: 15%;
94 | --color-canvas: hsla(var(--canvas-h), var(--canvas-s), var(--canvas-l), 1);
95 | --color-canvas-pure: hsla(218, 28%, 12%, 1);
96 | --color-canvas-50: hsla(218, 28%, 37%, 0.15);
97 | --color-canvas-100: hsla(218, 21%, 29%, 1);
98 | --color-canvas-200: hsla(218, 25%, 23%, 1);
99 | --color-canvas-300: hsla(218, 26%, 19%, 1);
100 | --color-canvas-dialog: hsla(218, 21%, 29%, 1);
101 | --color-border-dark: hsla(var(--canvas-h), 21%, 28%, 0.5);
102 | --color-border: hsla(var(--canvas-h), 22%, 33%, 0.5);
103 | --color-border-light: hsla(var(--canvas-h), 17%, 39%, 0.5);
104 | --color-border-input: hsla(var(--canvas-h), 17%, 35%, 0.8);
105 | --color-border-button: hsla(var(--canvas-h), 17%, 85%, 0.8);
106 | --primary-h: 211;
107 | --primary-s: 100%;
108 | --primary-l: 54%;
109 | --color-text-primary: hsla(211, 90%, 60%, 1);
110 | --color-primary-dark: hsla(211, 72%, 46%, 1);
111 | --color-primary: hsla(211, 90%, 54%, 1);
112 | --color-primary-light: hsla(211, 90%, 65%, 1);
113 | --color-primary-tint: hsla(211, 90%, 65%, 0.25);
114 | --color-on-primary: hsla(211, 100%, 100%, 1);
115 | --success-h: 160;
116 | --success-s: 84%;
117 | --success-l: 75%;
118 | --color-text-success: hsla(160, 76%, 60%, 1);
119 | --color-success-dark: hsla(160, 60%, 64%, 1);
120 | --color-success: hsla(160, 76%, 75%, 1);
121 | --color-success-light: hsla(160, 76%, 90%, 1);
122 | --color-success-tint: hsla(160, 76%, 65%, 0.25);
123 | --color-on-success: hsla(160, 84%, 100%, 1);
124 | --warning-h: 20;
125 | --warning-s: 90%;
126 | --warning-l: 58%;
127 | --color-text-warning: hsla(20, 81%, 60%, 1);
128 | --color-warning-dark: hsla(20, 65%, 49%, 1);
129 | --color-warning: hsla(20, 81%, 58%, 1);
130 | --color-warning-light: hsla(20, 81%, 70%, 1);
131 | --color-warning-tint: hsla(20, 81%, 65%, 0.25);
132 | --color-on-warning: hsla(20, 90%, 100%, 1);
133 | --danger-h: 0;
134 | --danger-s: 84%;
135 | --danger-l: 53%;
136 | --color-text-danger: hsla(0, 76%, 60%, 1);
137 | --color-danger-dark: hsla(0, 60%, 45%, 1);
138 | --color-danger: hsla(0, 76%, 53%, 1);
139 | --color-danger-light: hsla(0, 76%, 64%, 1);
140 | --color-danger-tint: hsla(0, 76%, 65%, 0.25);
141 | --color-on-danger: hsla(0, 84%, 100%, 1);
142 |
143 | }
144 | [data-theme="dark"],
145 | [data-theme="dark"] .sl-inverted .sl-inverted,
146 | [data-theme="dark"] .sl-inverted .sl-inverted .sl-inverted .sl-inverted {
147 | color: var(--color-text);
148 |
149 | --text-h: 0;
150 | --text-s: 0%;
151 | --text-l: 91%;
152 | --shadow-sm: 0px 0px 1px rgba(11, 13, 19, 0.5);
153 | --shadow-md: 0px 2px 4px -2px rgba(0, 0, 0, 0.35), 0px 0px 1px rgba(11, 13, 19, 0.4);
154 | --shadow-lg: 0 2px 14px rgba(0,0,0,.55), 0 0 0 0.5px rgba(255,255,255,.3);
155 | --shadow-xl: 0px 0px 1px rgba(11, 13, 19, 0.4), 0px 8px 10px -4px rgba(11, 13, 19, 0.55);
156 | --shadow-2xl: 0px 0px 1px rgba(11, 13, 19, 0.4), 0px 16px 24px -8px rgba(11, 13, 19, 0.55);
157 | --color-text-heading: hsla(var(--text-h), var(--text-s), max(3, calc(var(--text-l) - 10)), 1);
158 | --color-text: hsla(var(--text-h), var(--text-s), var(--text-l), 1);
159 | --color-text-paragraph: hsla(var(--text-h), var(--text-s), var(--text-l), 0.9);
160 | --color-text-muted: hsla(var(--text-h), var(--text-s), var(--text-l), 0.7);
161 | --color-text-light: hsla(var(--text-h), var(--text-s), var(--text-l), 0.55);
162 | --canvas-h: 218;
163 | --canvas-s: 34%;
164 | --canvas-l: 10%;
165 | --color-canvas: hsla(var(--canvas-h), var(--canvas-s), var(--canvas-l), 1);
166 | --color-canvas-pure: hsla(218, 34%, 7%, 1);
167 | --color-canvas-50: hsla(218, 34%, 32%, 0.15);
168 | --color-canvas-100: hsla(218, 26%, 24%, 1);
169 | --color-canvas-200: hsla(218, 31%, 18%, 1);
170 | --color-canvas-300: hsla(218, 32%, 14%, 1);
171 | --color-canvas-dialog: hsla(218, 26%, 24%, 1);
172 | --color-border-dark: hsla(var(--canvas-h), 26%, 23%, 0.5);
173 | --color-border: hsla(var(--canvas-h), 27%, 28%, 0.5);
174 | --color-border-light: hsla(var(--canvas-h), 20%, 34%, 0.5);
175 | --color-border-input: hsla(var(--canvas-h), 20%, 30%, 0.8);
176 | --color-border-button: hsla(var(--canvas-h), 20%, 85%, 0.8);
177 | --primary-h: 211;
178 | --primary-s: 100%;
179 | --primary-l: 61%;
180 | --color-text-primary: hsla(211, 100%, 60%, 1);
181 | --color-primary-dark: hsla(211, 80%, 52%, 1);
182 | --color-primary: hsla(211, 100%, 61%, 1);
183 | --color-primary-light: hsla(211, 100%, 73%, 1);
184 | --color-primary-tint: hsla(211, 100%, 65%, 0.25);
185 | --color-on-primary: hsla(211, 100%, 100%, 1);
186 | --success-h: 160;
187 | --success-s: 84%;
188 | --success-l: 34%;
189 | --color-text-success: hsla(160, 84%, 60%, 1);
190 | --color-success-dark: hsla(160, 67%, 29%, 1);
191 | --color-success: hsla(160, 84%, 34%, 1);
192 | --color-success-light: hsla(160, 84%, 41%, 1);
193 | --color-success-tint: hsla(160, 84%, 65%, 0.25);
194 | --color-on-success: hsla(160, 84%, 100%, 1);
195 | --warning-h: 20;
196 | --warning-s: 90%;
197 | --warning-l: 56%;
198 | --color-text-warning: hsla(20, 90%, 60%, 1);
199 | --color-warning-dark: hsla(20, 72%, 48%, 1);
200 | --color-warning: hsla(20, 90%, 56%, 1);
201 | --color-warning-light: hsla(20, 90%, 67%, 1);
202 | --color-warning-tint: hsla(20, 90%, 65%, 0.25);
203 | --color-on-warning: hsla(20, 90%, 100%, 1);
204 | --danger-h: 0;
205 | --danger-s: 84%;
206 | --danger-l: 63%;
207 | --color-text-danger: hsla(0, 84%, 60%, 1);
208 | --color-danger-dark: hsla(0, 67%, 54%, 1);
209 | --color-danger: hsla(0, 84%, 63%, 1);
210 | --color-danger-light: hsla(0, 84%, 76%, 1);
211 | --color-danger-tint: hsla(0, 84%, 65%, 0.25);
212 | --color-on-danger: hsla(0, 84%, 100%, 1);
213 |
214 | }
215 |
216 | [data-theme="dark"] .sl-inverted,
217 | [data-theme="dark"] .sl-inverted .sl-inverted .sl-inverted {
218 | color: var(--color-text);
219 |
220 | --text-h: 0;
221 | --text-s: 0%;
222 | --text-l: 97%;
223 | --shadow-sm: 0px 0px 1px rgba(11, 13, 19, 0.5);
224 | --shadow-md: 0px 2px 4px -2px rgba(0, 0, 0, 0.35), 0px 0px 1px rgba(11, 13, 19, 0.4);
225 | --shadow-lg: 0 2px 14px rgba(0,0,0,.55), 0 0 0 0.5px rgba(255,255,255,.3);
226 | --shadow-xl: 0px 0px 1px rgba(11, 13, 19, 0.4), 0px 8px 10px -4px rgba(11, 13, 19, 0.55);
227 | --shadow-2xl: 0px 0px 1px rgba(11, 13, 19, 0.4), 0px 16px 24px -8px rgba(11, 13, 19, 0.55);
228 | --color-text-heading: hsla(var(--text-h), var(--text-s), max(3, calc(var(--text-l) - 10)), 1);
229 | --color-text: hsla(var(--text-h), var(--text-s), var(--text-l), 1);
230 | --color-text-paragraph: hsla(var(--text-h), var(--text-s), var(--text-l), 0.9);
231 | --color-text-muted: hsla(var(--text-h), var(--text-s), var(--text-l), 0.7);
232 | --color-text-light: hsla(var(--text-h), var(--text-s), var(--text-l), 0.55);
233 | --canvas-h: 218;
234 | --canvas-s: 34%;
235 | --canvas-l: 15%;
236 | --color-canvas: hsla(var(--canvas-h), var(--canvas-s), var(--canvas-l), 1);
237 | --color-canvas-pure: hsla(218, 34%, 12%, 1);
238 | --color-canvas-50: hsla(218, 34%, 24%, 0.15);
239 | --color-canvas-100: hsla(218, 26%, 19%, 1);
240 | --color-canvas-200: hsla(218, 31%, 15%, 1);
241 | --color-canvas-300: hsla(218, 32%, 12%, 1);
242 | --color-canvas-dialog: hsla(218, 26%, 19%, 1);
243 | --color-border-dark: hsla(var(--canvas-h), 26%, 28%, 0.5);
244 | --color-border: hsla(var(--canvas-h), 27%, 33%, 0.5);
245 | --color-border-light: hsla(var(--canvas-h), 20%, 39%, 0.5);
246 | --color-border-input: hsla(var(--canvas-h), 20%, 35%, 0.8);
247 | --color-border-button: hsla(var(--canvas-h), 20%, 85%, 0.8);
248 | --primary-h: 211;
249 | --primary-s: 100%;
250 | --primary-l: 54%;
251 | --color-text-primary: hsla(211, 80%, 60%, 1);
252 | --color-primary-dark: hsla(211, 64%, 30%, 1);
253 | --color-primary: hsla(211, 80%, 35%, 1);
254 | --color-primary-light: hsla(211, 80%, 42%, 1);
255 | --color-primary-tint: hsla(211, 80%, 42%, 0.25);
256 | --color-on-primary: hsla(211, 100%, 100%, 1);
257 | --success-h: 160;
258 | --success-s: 84%;
259 | --success-l: 75%;
260 | --color-text-success: hsla(160, 67%, 60%, 1);
261 | --color-success-dark: hsla(160, 54%, 41%, 1);
262 | --color-success: hsla(160, 67%, 49%, 1);
263 | --color-success-light: hsla(160, 67%, 59%, 1);
264 | --color-success-tint: hsla(160, 67%, 42%, 0.25);
265 | --color-on-success: hsla(160, 84%, 100%, 1);
266 | --warning-h: 20;
267 | --warning-s: 90%;
268 | --warning-l: 58%;
269 | --color-text-warning: hsla(20, 72%, 60%, 1);
270 | --color-warning-dark: hsla(20, 58%, 32%, 1);
271 | --color-warning: hsla(20, 72%, 38%, 1);
272 | --color-warning-light: hsla(20, 72%, 45%, 1);
273 | --color-warning-tint: hsla(20, 72%, 42%, 0.25);
274 | --color-on-warning: hsla(20, 90%, 100%, 1);
275 | --danger-h: 0;
276 | --danger-s: 84%;
277 | --danger-l: 53%;
278 | --color-text-danger: hsla(0, 67%, 60%, 1);
279 | --color-danger-dark: hsla(0, 54%, 29%, 1);
280 | --color-danger: hsla(0, 67%, 34%, 1);
281 | --color-danger-light: hsla(0, 67%, 41%, 1);
282 | --color-danger-tint: hsla(0, 67%, 42%, 0.25);
283 | --color-on-danger: hsla(0, 84%, 100%, 1);
284 |
285 | }
--------------------------------------------------------------------------------