node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

7
server/node_modules/@strapi/ui-primitives/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,7 @@
Copyright (c) 2015-present Strapi Solutions SAS
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

123
server/node_modules/@strapi/ui-primitives/README.md generated vendored Normal file
View File

@@ -0,0 +1,123 @@
# Strapi Primitives
[![Version](https://img.shields.io/npm/v/@strapi/ui-primitives?style=flat&colorA=4945ff&colorB=4945ff)](https://www.npmjs.com/package/@strapi/ui-primitives)
[![Downloads](https://img.shields.io/npm/dt/@strapi/ui-primitives.svg?style=flat&colorA=4945ff&colorB=4945ff)](https://www.npmjs.com/package/@strapi/ui-primitives)
[![Discord Shield](https://img.shields.io/discord/811989166782021633?style=flat&colorA=4945ff&colorB=4945ff&label=discord&logo=discord&logoColor=f0f0ff)](https://discord.gg/strapi)
<b>A UI component library for building accessibile design systems & web apps.</b>
While typically we use [radix-ui primitives](https://github.com/radix-ui/primitives) in our design-system, there are some missing components. To solve this issue, we work with Radix's internal packages & APIs to develop base layer primitives in a composable manor until they are (hopefully) released through Radix and we can deprecate them here.
## Installation
```shell
yarn add @strapi/ui-primitives
# or
npm i @strapi/ui-primitives
```
## Component Documentation
This directory shows a basic usage of the component, however for more details click on the storybook badge.
<ul>
<li><a href="#combobox">Combobox</a></li>
<li><a href="#select">Select</a></li>
</ul>
### Combobox
[![](https://img.shields.io/badge/-storybook-%234945ff)](https://design-system-git-main-strapijs.vercel.app/?path=/story/design-system-primitives-combobox--basic-usage)
#### Basic Usage
```jsx
import { Combobox } from '@strapi/ui-primitives';
() => {
return (
<Combobox.Root>
<Combobox.Trigger>
<Combobox.TextInput placeholder="Pick me" />
<Combobox.Icon />
</Combobox.Trigger>
<Combobox.Portal>
<Combobox.Content>
<Combobox.Viewport>
<Combobox.Item value="1">
<Combobox.ItemText>Option 1</Combobox.ItemText>
<Combobox.ItemIndicator>
<Check />
</Combobox.ItemIndicator>
</Combobox.Item>
<Combobox.NoValueFound>No value found</Combobox.NoValueFound>
<Combobox.CreateItem>Create a new value</Combobox.CreateItem>
</Combobox.Viewport>
</Combobox.Content>
</Combobox.Portal>
</Combobox.Root>
);
};
```
### Select
[![](https://img.shields.io/badge/-storybook-%234945ff)](https://design-system-git-main-strapijs.vercel.app/?path=/story/design-system-primitives-select--basic-usage)
#### Basic Usage
```jsx
import { Select } from '@strapi/ui-primitives';
() => {
return (
<Select.Root>
<Select.Trigger>
<Select.Value placeholder="Pick me" />
<Select.Icon />
</Select.Trigger>
<Select.Portal>
<Select.Content>
<Select.Viewport>
<Select.Item value="1">
<Select.ItemText>Option 1</Select.ItemText>
<Select.ItemIndicator>
<Check />
</Select.ItemIndicator>
</Select.Item>
</Select.Viewport>
</Select.Content>
</Select.Portal>
</Select.Root>
);
};
```
## Hook Documentation
### useCallbackRef
Converts a callback to a ref to avoid triggering re-renders when passed as a prop or avoid re-executing
effects when passed as a dependency
### useCollator
Provides localized string collation for the current locale. Automatically updates when the locale changes,
and handles caching of the collator for performance.
### useFilter
Provides localized string search functionality that is useful for filtering or matching items
in a list. Options can be provided to adjust the sensitivity to case, diacritics, and other parameters.
## Contributing
Please follow our [CONTRIBUTING](https://github.com/strapi/design-system/blob/main/CONTRIBUTING.md) guidelines.
## License
Licensed under the MIT License, Copyright © 2022-present [Strapi Solutions SAS](https://strapi.io).
See [LICENSE](https://github.com/strapi/design-system/blob/main/LICENSE) for more information.

View File

@@ -0,0 +1,38 @@
/**
* An internal fork of Radix UI's `Collection` component.
*
* We've added a subscription API to allow us to subscribe to changes in the collection via the useCollection hook.
*/
import * as React from 'react';
import { Slot } from '@radix-ui/react-slot';
import type * as Radix from '@radix-ui/react-primitive';
type SlotProps = Radix.ComponentPropsWithoutRef<typeof Slot>;
interface CollectionProps extends SlotProps {
scope: any;
}
interface CollectionProviderProps {
children?: React.ReactNode;
scope: any;
}
declare function createCollection<ItemElement extends HTMLElement, ItemData = object>(name: string): readonly [{
readonly Provider: {
(props: CollectionProviderProps): import("react/jsx-runtime").JSX.Element;
displayName: string;
};
readonly Slot: React.ForwardRefExoticComponent<CollectionProps & React.RefAttributes<HTMLElement>>;
readonly ItemSlot: React.ForwardRefExoticComponent<React.PropsWithoutRef<ItemData & {
children: React.ReactNode;
scope: any;
}> & React.RefAttributes<ItemElement>>;
}, (scope: any) => {
getItems: () => ({
ref: React.RefObject<ItemElement>;
} & ItemData)[];
subscribe: (listener: (newState: ({
ref: React.RefObject<ItemElement>;
} & ItemData)[], prevState: ({
ref: React.RefObject<ItemElement>;
} & ItemData)[]) => void) => () => boolean;
}, import("@radix-ui/react-context").CreateScope];
export { createCollection };
export type { CollectionProps, CollectionProviderProps };

View File

@@ -0,0 +1,125 @@
import * as React from 'react';
import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
import * as PopperPrimitive from '@radix-ui/react-popper';
import { Portal as PortalPrimitive } from '@radix-ui/react-portal';
import { Primitive } from '@radix-ui/react-primitive';
import type { ComponentPropsWithoutRef } from '@radix-ui/react-primitive';
type AutocompleteObject = {
type: 'none';
filter?: never;
} | {
type: 'list';
filter: 'contains' | 'startsWith';
} | {
type: 'both';
filter: 'startsWith';
};
type Autocomplete = 'none' | 'list' | 'both' | AutocompleteObject;
interface RootProps {
allowCustomValue?: boolean;
autocomplete?: Autocomplete;
children?: React.ReactNode;
defaultOpen?: boolean;
defaultValue?: string;
defaultTextValue?: string;
disabled?: boolean;
locale?: string;
onOpenChange?(open: boolean): void;
onValueChange?(value: string): void;
onTextValueChange?(textValue: string): void;
textValue?: string;
open?: boolean;
required?: boolean;
value?: string;
defaultFilterValue?: string;
filterValue?: string;
onFilterValueChange?(value: string): void;
isPrintableCharacter?: (str: string) => boolean;
visible?: boolean;
}
type TriggerProps = PrimitiveDivProps;
type TextInputProps = React.InputHTMLAttributes<HTMLInputElement>;
type PrimitiveButtonProps = ComponentPropsWithoutRef<typeof Primitive.button>;
type IconProps = PrimitiveButtonProps;
type IPortalProps = React.ComponentPropsWithoutRef<typeof PortalPrimitive>;
interface PortalProps extends Omit<IPortalProps, 'asChild'> {
children?: React.ReactNode;
}
type ContentProps = ComboboxContentImplProps;
type DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;
type ComboboxPopperPrivateProps = {
onPlaced?: PopperContentProps['onPlaced'];
};
interface ComboboxContentImplProps extends Omit<ComboboxPopperPositionProps, keyof ComboboxPopperPrivateProps> {
/**
* Event handler called when the escape key is down.
* Can be prevented.
*/
onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];
/**
* Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`.
* Can be prevented.
*/
onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];
}
type PopperContentProps = React.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
interface ComboboxPopperPositionProps extends PopperContentProps, ComboboxPopperPrivateProps {
}
type PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;
type ViewportProps = PrimitiveDivProps;
interface ItemProps extends ItemImplProps {
textValue?: string;
}
export declare const ComboboxItem: React.ForwardRefExoticComponent<ItemProps & React.RefAttributes<HTMLDivElement>>;
interface ItemImplProps extends PrimitiveDivProps {
value: string;
disabled?: boolean;
}
type PrimitiveSpanProps = ComponentPropsWithoutRef<typeof Primitive.span>;
type ItemTextProps = PrimitiveSpanProps;
type ItemIndicatorProps = PrimitiveSpanProps;
type NoValueFoundProps = PrimitiveDivProps;
interface CreateItemProps extends PrimitiveDivProps {
disabled?: boolean;
}
declare const Root: (props: RootProps) => import("react/jsx-runtime").JSX.Element;
declare const Trigger: React.ForwardRefExoticComponent<Pick<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
} & {
asChild?: boolean | undefined;
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & React.RefAttributes<HTMLDivElement>>;
declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
declare const Icon: React.ForwardRefExoticComponent<Pick<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
} & {
asChild?: boolean | undefined;
}, "key" | "asChild" | keyof React.ButtonHTMLAttributes<HTMLButtonElement>> & React.RefAttributes<HTMLButtonElement>>;
declare const Portal: {
(props: PortalProps): import("react/jsx-runtime").JSX.Element;
displayName: string;
};
declare const Content: React.ForwardRefExoticComponent<ComboboxContentImplProps & React.RefAttributes<HTMLDivElement>>;
declare const Viewport: React.ForwardRefExoticComponent<Pick<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
} & {
asChild?: boolean | undefined;
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & React.RefAttributes<HTMLDivElement>>;
declare const Item: React.ForwardRefExoticComponent<ItemProps & React.RefAttributes<HTMLDivElement>>;
declare const ItemText: React.ForwardRefExoticComponent<Pick<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
} & {
asChild?: boolean | undefined;
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLSpanElement>> & React.RefAttributes<HTMLSpanElement>>;
declare const ItemIndicator: React.ForwardRefExoticComponent<Pick<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
} & {
asChild?: boolean | undefined;
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLSpanElement>> & React.RefAttributes<HTMLSpanElement>>;
declare const NoValueFound: React.ForwardRefExoticComponent<Pick<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
} & {
asChild?: boolean | undefined;
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & React.RefAttributes<HTMLDivElement>>;
declare const CreateItem: React.ForwardRefExoticComponent<CreateItemProps & React.RefAttributes<HTMLDivElement>>;
export { Root, Trigger, TextInput, Icon, Portal, Content, Viewport, Item, ItemText, ItemIndicator, NoValueFound, CreateItem, };
export type { RootProps, TriggerProps, TextInputProps, IconProps, PortalProps, ContentProps, ViewportProps, ItemProps, ItemTextProps, ItemIndicatorProps, NoValueFoundProps, CreateItemProps, Autocomplete, AutocompleteObject, };

View File

@@ -0,0 +1 @@
export * as Combobox from './Combobox';

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
export * as Select from './Select';

View File

@@ -0,0 +1,4 @@
declare function composeEventHandlers<E>(originalEventHandler?: (event: E) => void, ourEventHandler?: (event: E) => void, { checkForDefaultPrevented }?: {
checkForDefaultPrevented?: boolean | undefined;
}): (event: E) => void;
export { composeEventHandlers };

View File

@@ -0,0 +1,6 @@
/**
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
* prop or avoid re-executing effects when passed as a dependency
*/
declare function useCallbackRef<T extends (...args: any[]) => any>(callback: T | undefined): T;
export { useCallbackRef };

View File

@@ -0,0 +1,9 @@
/**
* Stolen from @react-aria/i18n
*/
/**
* Provides localized string collation for the current locale. Automatically updates when the locale changes,
* and handles caching of the collator for performance.
* @param options - Collator options.
*/
export declare function useCollator(locale: string, options?: Intl.CollatorOptions): Intl.Collator;

View File

@@ -0,0 +1,16 @@
/**
* Stolen from @react-aria/i18n
*/
export interface Filter {
/** Returns whether a string starts with a given substring. */
startsWith(string: string, substring: string): boolean;
/** Returns whether a string ends with a given substring. */
endsWith(string: string, substring: string): boolean;
/** Returns whether a string contains a given substring. */
contains(string: string, substring: string): boolean;
}
/**
* Provides localized string search functionality that is useful for filtering or matching items
* in a list. Options can be provided to adjust the sensitivity to case, diacritics, and other parameters.
*/
export declare function useFilter(locale: string, options?: Intl.CollatorOptions): Filter;

View File

@@ -0,0 +1 @@
export declare const usePrev: <T>(value: T) => T | undefined;

View File

@@ -0,0 +1,8 @@
export * from './components/Collection';
export * from './components/Combobox';
export * from './components/Select';
export * from './helpers/events';
export * from './hooks/useCallbackRef';
export * from './hooks/useCollator';
export * from './hooks/useFilter';
export * from './hooks/usePrev';

2223
server/node_modules/@strapi/ui-primitives/dist/index.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

2203
server/node_modules/@strapi/ui-primitives/dist/index.mjs generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

56
server/node_modules/@strapi/ui-primitives/package.json generated vendored Normal file
View File

@@ -0,0 +1,56 @@
{
"name": "@strapi/ui-primitives",
"version": "2.0.0-rc.23",
"license": "MIT",
"sideEffects": false,
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "pack-up build",
"clean": "rimraf dist node_modules",
"lint": "eslint . --ext .js,.jsx,.tsx,.ts",
"format": "yarn lint --fix",
"test:ts": "tsc --noEmit",
"test:unit": "jest -c jest.config.mjs",
"watch": "pack-up watch"
},
"dependencies": {
"@radix-ui/number": "1.0.1",
"@radix-ui/primitive": "1.0.1",
"@radix-ui/react-collection": "1.0.3",
"@radix-ui/react-compose-refs": "1.0.1",
"@radix-ui/react-context": "1.0.1",
"@radix-ui/react-direction": "1.0.1",
"@radix-ui/react-dismissable-layer": "1.0.5",
"@radix-ui/react-focus-guards": "1.0.1",
"@radix-ui/react-focus-scope": "1.0.4",
"@radix-ui/react-id": "1.0.1",
"@radix-ui/react-popper": "1.1.3",
"@radix-ui/react-portal": "1.0.4",
"@radix-ui/react-primitive": "1.0.3",
"@radix-ui/react-slot": "1.0.2",
"@radix-ui/react-use-controllable-state": "1.0.1",
"@radix-ui/react-use-layout-effect": "1.0.1",
"@radix-ui/react-use-previous": "1.0.1",
"@radix-ui/react-visually-hidden": "1.0.3",
"aria-hidden": "1.2.4",
"react-remove-scroll": "2.5.10"
},
"devDependencies": {
"@strapi/pack-up": "5.0.0",
"jest": "29.7.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"rimraf": "5.0.7",
"typescript": "5.4.5"
},
"peerDependencies": {
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0"
}
}