@sps-woodland/tabs 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/lib/Tabs.examples.d.ts +2 -0
- package/lib/index.cjs.js +64 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.es.js +2320 -0
- package/lib/manifest.d.ts +2 -0
- package/lib/style.css +1 -0
- package/lib/tab/Tab.css.d.ts +11 -0
- package/lib/tab/Tab.d.ts +9 -0
- package/lib/tab-panel/TabPanel.d.ts +8 -0
- package/lib/tabs/Tabs.css.d.ts +20 -0
- package/lib/tabs/Tabs.d.ts +5 -0
- package/package.json +51 -0
- package/vite.config.js +21 -0
package/lib/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.kz6kzz0{align-items:center;border-top-width:.0625rem;border-right-width:.0625rem;border-style:solid;cursor:pointer;display:flex;font-size:.75rem;font-weight:600;line-height:.875rem;padding:.5rem 1rem}.kz6kzz1{border-bottom-width:0;border-left-width:.0625rem;border-top-left-radius:.25rem;border-top-right-radius:.25rem;color:#717779;margin-bottom:-1px}.kz6kzz2{border-bottom-width:.0625rem;border-left-width:0}.kz6kzz2:first-child{border-left-width:.0625rem;border-bottom-left-radius:.25rem;border-top-left-radius:.25rem}.kz6kzz2:last-child{border-bottom-right-radius:.25rem;border-top-right-radius:.25rem}.kz6kzz5{cursor:not-allowed}.kz6kzz7{background-color:#fff;border-color:#d2d4d4;color:#1f282c}.kz6kzz8{border-color:transparent}.kz6kzz9:hover{background-color:#f3f4f4;border-color:#d2d4d4;box-shadow:0 -.0625rem #d2d4d4 inset}.kz6kzza{background-color:#007db8;border-color:#007db8;color:#fff}.kz6kzzb{background-color:#fff;border-color:#d2d4d4;color:#4b5356}.kz6kzzc:hover{background-color:#f3f4f4}.kz6kzzd{color:#717779}.kz6kzzk{background-color:#fff;color:#4b5356}.fy26er0{display:flex;flex-wrap:wrap}.fy26er1{background-color:#e9e9ea;border-bottom-color:#d2d4d4;border-bottom-style:solid;border-bottom-width:.0625rem;border-top-left-radius:.25rem;border-top-right-radius:.25rem;padding-top:1rem;padding-left:1rem;padding-right:1rem}.fy26er2{margin-bottom:1rem}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RecipeVariants } from "@vanilla-extract/recipes";
|
|
2
|
+
import type { VariantDefinitions, RecipeVariant, BooleanRecipeVariant } from "@sps-woodland/core";
|
|
3
|
+
interface TabVariantDefinitions extends VariantDefinitions {
|
|
4
|
+
context: RecipeVariant<"container" | "navigation">;
|
|
5
|
+
active: BooleanRecipeVariant;
|
|
6
|
+
disabled: BooleanRecipeVariant;
|
|
7
|
+
}
|
|
8
|
+
export declare const tab: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<TabVariantDefinitions>;
|
|
9
|
+
export declare type TabVariants = NonNullable<RecipeVariants<typeof tab>>;
|
|
10
|
+
export declare const tabTag: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<TabVariantDefinitions>;
|
|
11
|
+
export {};
|
package/lib/tab/Tab.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TabListState } from "@react-stately/tabs";
|
|
2
|
+
import type { Node } from "@react-types/shared";
|
|
3
|
+
import type { ComponentProps } from "@sps-woodland/core";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import type { TabsVariants } from "../tabs/Tabs.css";
|
|
6
|
+
export declare function Tab<T>({ context, item, state, ...rest }: ComponentProps<TabsVariants & {
|
|
7
|
+
item: Node<T>;
|
|
8
|
+
state: TabListState<T>;
|
|
9
|
+
}, HTMLDivElement>): React.ReactElement;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TabListState } from "@react-stately/tabs";
|
|
2
|
+
import type { AriaTabPanelProps } from "@react-types/tabs";
|
|
3
|
+
import type { ComponentProps } from "@sps-woodland/core";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import type { TabsVariants } from "../tabs/Tabs.css";
|
|
6
|
+
export declare function TabPanel<T>({ context, "data-testid": dataTestId, state, ...rest }: AriaTabPanelProps & ComponentProps<TabsVariants & {
|
|
7
|
+
state: TabListState<T>;
|
|
8
|
+
}, HTMLDivElement>): React.ReactElement;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RecipeVariants } from "@vanilla-extract/recipes";
|
|
2
|
+
export declare const tabs: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
|
|
3
|
+
context: {
|
|
4
|
+
container: {
|
|
5
|
+
backgroundColor: string;
|
|
6
|
+
borderBottomColor: string;
|
|
7
|
+
borderBottomStyle: any;
|
|
8
|
+
borderBottomWidth: string;
|
|
9
|
+
borderTopLeftRadius: string;
|
|
10
|
+
borderTopRightRadius: string;
|
|
11
|
+
paddingTop: string;
|
|
12
|
+
paddingLeft: string;
|
|
13
|
+
paddingRight: string;
|
|
14
|
+
};
|
|
15
|
+
navigation: {
|
|
16
|
+
marginBottom: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
export declare type TabsVariants = RecipeVariants<typeof tabs>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TabListProps } from "@react-types/tabs";
|
|
2
|
+
import type { ComponentProps } from "@sps-woodland/core";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { TabsVariants } from "./Tabs.css";
|
|
5
|
+
export declare function Tabs({ className, context, "data-testid": dataTestId, ...rest }: TabListProps<Record<string, unknown>> & ComponentProps<TabsVariants, HTMLDivElement>): React.ReactElement;
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sps-woodland/tabs",
|
|
3
|
+
"description": "SPS Woodland Design System tabs component",
|
|
4
|
+
"version": "7.0.0",
|
|
5
|
+
"author": "SPS Commerce",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/tabs",
|
|
8
|
+
"homepage": "https://github.com/SPSCommerce/woodland/tree/master/packages/@sps-woodland/tabs#readme",
|
|
9
|
+
"main": "./lib/index.es.js",
|
|
10
|
+
"module": "./lib/index.es.js",
|
|
11
|
+
"types": "./lib/index.d.ts",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"@react-stately/collections": "^3.3.3",
|
|
17
|
+
"@sps-woodland/core": "7.0.0",
|
|
18
|
+
"@sps-woodland/tokens": "7.0.0",
|
|
19
|
+
"@spscommerce/utils": "^6.12.1",
|
|
20
|
+
"react": "^16.9.0",
|
|
21
|
+
"react-dom": "^16.9.0"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@react-stately/collections": "^3.3.3",
|
|
25
|
+
"@react-types/shared": "^3.8.0",
|
|
26
|
+
"@react-types/tabs": "^3.0.1",
|
|
27
|
+
"@types/react": "^16.9.0",
|
|
28
|
+
"@vanilla-extract/css": "^1.9.1",
|
|
29
|
+
"@vanilla-extract/recipes": "^0.2.5",
|
|
30
|
+
"@vanilla-extract/sprinkles": "^1.5.0",
|
|
31
|
+
"@vanilla-extract/vite-plugin": "^3.6.0",
|
|
32
|
+
"@sps-woodland/core": "7.0.0",
|
|
33
|
+
"@sps-woodland/tokens": "7.0.0",
|
|
34
|
+
"@spscommerce/utils": "^6.12.1",
|
|
35
|
+
"react": "^16.9.0",
|
|
36
|
+
"react-dom": "^16.9.0",
|
|
37
|
+
"vite": "^3.1.4"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@react-aria/tabs": "^3.0.1",
|
|
41
|
+
"@react-stately/tabs": "^3.0.1"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "pnpm run build:js && pnpm run build:types",
|
|
45
|
+
"build:js": "vite build",
|
|
46
|
+
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir lib",
|
|
47
|
+
"watch": "vite build --watch",
|
|
48
|
+
"clean": "git clean -fdX",
|
|
49
|
+
"pub": "node ../../../scripts/publish-package.js"
|
|
50
|
+
}
|
|
51
|
+
}
|
package/vite.config.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
|
|
3
|
+
import { defineConfig } from "vite";
|
|
4
|
+
|
|
5
|
+
import pkg from "./package.json";
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
plugins: [vanillaExtractPlugin()],
|
|
9
|
+
build: {
|
|
10
|
+
lib: {
|
|
11
|
+
entry: path.resolve(__dirname, "src/index.ts"),
|
|
12
|
+
formats: ["es", "cjs"],
|
|
13
|
+
fileName: (format) => `index.${format}.js`,
|
|
14
|
+
},
|
|
15
|
+
outDir: path.resolve(__dirname, "./lib"),
|
|
16
|
+
emptyOutDir: false,
|
|
17
|
+
rollupOptions: {
|
|
18
|
+
external: pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [],
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
});
|