@launchdarkly/toolbar 0.0.1
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/LICENSE +13 -0
- package/README.md +197 -0
- package/dist/index.d.ts +3 -0
- package/dist/js/index.js +4157 -0
- package/dist/services/DevServerClient.d.ts +34 -0
- package/dist/services/FlagStateManager.d.ts +15 -0
- package/dist/static/font/Audimat3000-Regulier.var-subset.woff2 +0 -0
- package/dist/static/font/Inter.var-subset.woff2 +0 -0
- package/dist/tests/LaunchDarklyToolbar.test.d.ts +1 -0
- package/dist/tests/Tabs.test.d.ts +1 -0
- package/dist/tests/mocks/flags.d.ts +2 -0
- package/dist/types/devServer.d.ts +29 -0
- package/dist/ui/List/List.css.d.ts +2 -0
- package/dist/ui/List/List.d.ts +5 -0
- package/dist/ui/List/ListItem.d.ts +6 -0
- package/dist/ui/Tabs/TabButton.d.ts +8 -0
- package/dist/ui/Tabs/Tabs.css.d.ts +6 -0
- package/dist/ui/Tabs/Tabs.d.ts +8 -0
- package/dist/ui/Tabs/useTabsContext.d.ts +7 -0
- package/dist/ui/Toolbar/Header/Header.css.d.ts +18 -0
- package/dist/ui/Toolbar/Header/Header.d.ts +10 -0
- package/dist/ui/Toolbar/Header/components/ActionButtons.d.ts +10 -0
- package/dist/ui/Toolbar/Header/components/EnvironmentLabel.d.ts +5 -0
- package/dist/ui/Toolbar/Header/components/LogoSection.d.ts +1 -0
- package/dist/ui/Toolbar/Header/components/SearchSection.d.ts +8 -0
- package/dist/ui/Toolbar/Header/components/index.d.ts +4 -0
- package/dist/ui/Toolbar/LaunchDarklyToolbar.css.d.ts +12 -0
- package/dist/ui/Toolbar/LaunchDarklyToolbar.d.ts +10 -0
- package/dist/ui/Toolbar/TabContent/EventsTabContent.css.d.ts +3 -0
- package/dist/ui/Toolbar/TabContent/EventsTabContent.d.ts +1 -0
- package/dist/ui/Toolbar/TabContent/FlagTabContent.css.d.ts +8 -0
- package/dist/ui/Toolbar/TabContent/FlagTabContent.d.ts +1 -0
- package/dist/ui/Toolbar/TabContent/SettingsTab.css.d.ts +11 -0
- package/dist/ui/Toolbar/TabContent/SettingsTabContent.d.ts +1 -0
- package/dist/ui/Toolbar/components/ActionButtonsContainer.css.d.ts +4 -0
- package/dist/ui/Toolbar/components/ActionButtonsContainer.d.ts +6 -0
- package/dist/ui/Toolbar/components/CircleLogo.d.ts +5 -0
- package/dist/ui/Toolbar/components/ConnectionStatus.css.d.ts +4 -0
- package/dist/ui/Toolbar/components/ConnectionStatus.d.ts +6 -0
- package/dist/ui/Toolbar/components/ErrorMessage.css.d.ts +2 -0
- package/dist/ui/Toolbar/components/ErrorMessage.d.ts +5 -0
- package/dist/ui/Toolbar/components/ExpandedToolbarContent.d.ts +15 -0
- package/dist/ui/Toolbar/components/FlagControls.css.d.ts +11 -0
- package/dist/ui/Toolbar/components/FlagControls.d.ts +20 -0
- package/dist/ui/Toolbar/components/GenericHelpText.css.d.ts +3 -0
- package/dist/ui/Toolbar/components/GenericHelpText.d.ts +6 -0
- package/dist/ui/Toolbar/components/IconButton.css.d.ts +4 -0
- package/dist/ui/Toolbar/components/IconButton.d.ts +11 -0
- package/dist/ui/Toolbar/components/OverrideIndicator.css.d.ts +5 -0
- package/dist/ui/Toolbar/components/OverrideIndicator.d.ts +5 -0
- package/dist/ui/Toolbar/components/StatusDot.css.d.ts +1 -0
- package/dist/ui/Toolbar/components/StatusDot.d.ts +5 -0
- package/dist/ui/Toolbar/components/TabContentRenderer.d.ts +7 -0
- package/dist/ui/Toolbar/components/icons/ArrowUndoIcon.d.ts +5 -0
- package/dist/ui/Toolbar/components/icons/CancelCircleIcon.d.ts +5 -0
- package/dist/ui/Toolbar/components/icons/CheckIcon.d.ts +5 -0
- package/dist/ui/Toolbar/components/icons/ChevronDownIcon.d.ts +5 -0
- package/dist/ui/Toolbar/components/icons/DeleteIcon.d.ts +5 -0
- package/dist/ui/Toolbar/components/icons/EditIcon.d.ts +5 -0
- package/dist/ui/Toolbar/components/icons/GearIcon.d.ts +5 -0
- package/dist/ui/Toolbar/components/icons/Icon.css.d.ts +1 -0
- package/dist/ui/Toolbar/components/icons/LaunchDarklyIcon.d.ts +5 -0
- package/dist/ui/Toolbar/components/icons/SearchIcon.d.ts +5 -0
- package/dist/ui/Toolbar/components/icons/SyncIcon.d.ts +5 -0
- package/dist/ui/Toolbar/components/icons/ToggleOffIcon.d.ts +5 -0
- package/dist/ui/Toolbar/components/icons/XIcon.d.ts +5 -0
- package/dist/ui/Toolbar/components/icons/index.d.ts +11 -0
- package/dist/ui/Toolbar/components/index.d.ts +8 -0
- package/dist/ui/Toolbar/constants/animations.d.ts +99 -0
- package/dist/ui/Toolbar/constants/config.d.ts +3 -0
- package/dist/ui/Toolbar/constants/index.d.ts +2 -0
- package/dist/ui/Toolbar/context/LaunchDarklyToolbarProvider.d.ts +20 -0
- package/dist/ui/Toolbar/context/SearchProvider.d.ts +10 -0
- package/dist/ui/Toolbar/hooks/index.d.ts +3 -0
- package/dist/ui/Toolbar/hooks/useToolbarAnimations.d.ts +20 -0
- package/dist/ui/Toolbar/hooks/useToolbarState.d.ts +22 -0
- package/dist/ui/Toolbar/hooks/useToolbarVisibility.d.ts +5 -0
- package/dist/ui/Toolbar/types/index.d.ts +1 -0
- package/dist/ui/Toolbar/types/toolbar.d.ts +12 -0
- package/package.json +100 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export declare const EASING: {
|
|
2
|
+
readonly bounce: readonly [0.34, 1.56, 0.64, 1];
|
|
3
|
+
readonly smooth: readonly [0.25, 0.46, 0.45, 0.94];
|
|
4
|
+
readonly elastic: readonly [0.22, 1, 0.36, 1];
|
|
5
|
+
};
|
|
6
|
+
export declare const ANIMATION_CONFIG: {
|
|
7
|
+
readonly container: {
|
|
8
|
+
readonly width: {
|
|
9
|
+
readonly duration: 0.5;
|
|
10
|
+
readonly ease: readonly [0.34, 1.56, 0.64, 1];
|
|
11
|
+
};
|
|
12
|
+
readonly height: {
|
|
13
|
+
readonly duration: 0.5;
|
|
14
|
+
readonly ease: readonly [0.34, 1.56, 0.64, 1];
|
|
15
|
+
};
|
|
16
|
+
readonly borderRadius: {
|
|
17
|
+
readonly duration: 0.4;
|
|
18
|
+
readonly ease: readonly [0.25, 0.46, 0.45, 0.94];
|
|
19
|
+
};
|
|
20
|
+
readonly boxShadow: {
|
|
21
|
+
readonly duration: 0.3;
|
|
22
|
+
readonly ease: "easeInOut";
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
readonly circleLogo: {
|
|
26
|
+
readonly opacity: {
|
|
27
|
+
readonly duration: 0.25;
|
|
28
|
+
readonly ease: "easeOut";
|
|
29
|
+
};
|
|
30
|
+
readonly scale: {
|
|
31
|
+
readonly duration: 0.3;
|
|
32
|
+
readonly ease: readonly [0.25, 0.46, 0.45, 0.94];
|
|
33
|
+
};
|
|
34
|
+
readonly rotate: {
|
|
35
|
+
readonly duration: 0.3;
|
|
36
|
+
readonly ease: readonly [0.25, 0.46, 0.45, 0.94];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
readonly toolbarContent: {
|
|
40
|
+
readonly opacity: {
|
|
41
|
+
readonly duration: 0.4;
|
|
42
|
+
readonly ease: readonly [0.25, 0.46, 0.45, 0.94];
|
|
43
|
+
};
|
|
44
|
+
readonly y: {
|
|
45
|
+
readonly duration: 0.5;
|
|
46
|
+
readonly ease: readonly [0.34, 1.56, 0.64, 1];
|
|
47
|
+
};
|
|
48
|
+
readonly scale: {
|
|
49
|
+
readonly duration: 0.5;
|
|
50
|
+
readonly ease: readonly [0.34, 1.56, 0.64, 1];
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
readonly contentArea: {
|
|
54
|
+
readonly opacity: {
|
|
55
|
+
readonly duration: 0.4;
|
|
56
|
+
readonly ease: "easeInOut";
|
|
57
|
+
};
|
|
58
|
+
readonly maxHeight: {
|
|
59
|
+
readonly duration: 0.5;
|
|
60
|
+
readonly ease: readonly [0.22, 1, 0.36, 1];
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
readonly tabContent: {
|
|
64
|
+
readonly duration: 0.3;
|
|
65
|
+
readonly ease: readonly [0.25, 0.46, 0.45, 0.94];
|
|
66
|
+
};
|
|
67
|
+
readonly tabsContainer: {
|
|
68
|
+
readonly opacity: {
|
|
69
|
+
readonly duration: 0.5;
|
|
70
|
+
readonly ease: readonly [0.34, 1.56, 0.64, 1];
|
|
71
|
+
};
|
|
72
|
+
readonly y: {
|
|
73
|
+
readonly duration: 0.5;
|
|
74
|
+
readonly ease: readonly [0.34, 1.56, 0.64, 1];
|
|
75
|
+
};
|
|
76
|
+
readonly delay: 0.3;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
export declare const DIMENSIONS: {
|
|
80
|
+
readonly collapsed: {
|
|
81
|
+
readonly width: 60;
|
|
82
|
+
readonly height: 60;
|
|
83
|
+
readonly borderRadius: 30;
|
|
84
|
+
};
|
|
85
|
+
readonly expanded: {
|
|
86
|
+
readonly width: 400;
|
|
87
|
+
readonly borderRadius: 12;
|
|
88
|
+
};
|
|
89
|
+
readonly scale: {
|
|
90
|
+
readonly expanded: 1.02;
|
|
91
|
+
readonly collapsed: 1;
|
|
92
|
+
};
|
|
93
|
+
readonly slideDistance: 30;
|
|
94
|
+
};
|
|
95
|
+
export declare const SHADOWS: {
|
|
96
|
+
readonly expanded: "0 12px 48px rgba(0, 0, 0, 0.5)";
|
|
97
|
+
readonly hoveredCollapsed: "0 8px 40px rgba(0, 0, 0, 0.4)";
|
|
98
|
+
readonly collapsed: "0 4px 16px rgba(0, 0, 0, 0.3)";
|
|
99
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LdToolbarConfig, ToolbarState } from '../../../types/devServer';
|
|
3
|
+
interface LaunchDarklyToolbarContextValue {
|
|
4
|
+
state: ToolbarState & {
|
|
5
|
+
availableProjects: string[];
|
|
6
|
+
currentProjectKey: string | null;
|
|
7
|
+
};
|
|
8
|
+
setOverride: (flagKey: string, value: any) => Promise<void>;
|
|
9
|
+
clearOverride: (flagKey: string) => Promise<void>;
|
|
10
|
+
clearAllOverrides: () => Promise<void>;
|
|
11
|
+
refresh: () => Promise<void>;
|
|
12
|
+
switchProject: (projectKey: string) => Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare const useToolbarContext: () => LaunchDarklyToolbarContextValue;
|
|
15
|
+
export interface LaunchDarklyToolbarProviderProps {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
config: LdToolbarConfig;
|
|
18
|
+
}
|
|
19
|
+
export declare const LaunchDarklyToolbarProvider: React.FC<LaunchDarklyToolbarProviderProps>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { Dispatch, type SetStateAction } from 'react';
|
|
2
|
+
type SearchContextType = {
|
|
3
|
+
searchTerm: string;
|
|
4
|
+
setSearchTerm: Dispatch<SetStateAction<string>>;
|
|
5
|
+
};
|
|
6
|
+
export declare function SearchProvider({ children }: {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function useSearchContext(): SearchContextType;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { ANIMATION_CONFIG } from '../constants';
|
|
3
|
+
export interface UseToolbarAnimationsProps {
|
|
4
|
+
showFullToolbar: boolean;
|
|
5
|
+
isHovered: boolean;
|
|
6
|
+
setIsAnimating: Dispatch<SetStateAction<boolean>>;
|
|
7
|
+
}
|
|
8
|
+
export interface UseToolbarAnimationsReturn {
|
|
9
|
+
containerAnimations: {
|
|
10
|
+
width: number;
|
|
11
|
+
height: string | number;
|
|
12
|
+
borderRadius: number;
|
|
13
|
+
scale: number;
|
|
14
|
+
boxShadow: string;
|
|
15
|
+
};
|
|
16
|
+
animationConfig: typeof ANIMATION_CONFIG.container;
|
|
17
|
+
handleAnimationStart: () => void;
|
|
18
|
+
handleAnimationComplete: () => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function useToolbarAnimations(props: UseToolbarAnimationsProps): UseToolbarAnimationsReturn;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { ActiveTabId } from '../types';
|
|
3
|
+
export interface UseToolbarStateReturn {
|
|
4
|
+
isExpanded: boolean;
|
|
5
|
+
isHovered: boolean;
|
|
6
|
+
activeTab: ActiveTabId;
|
|
7
|
+
previousTab: ActiveTabId;
|
|
8
|
+
isAnimating: boolean;
|
|
9
|
+
searchIsExpanded: boolean;
|
|
10
|
+
showFullToolbar: boolean;
|
|
11
|
+
slideDirection: number;
|
|
12
|
+
hasBeenExpanded: boolean;
|
|
13
|
+
toolbarRef: React.RefObject<HTMLDivElement | null>;
|
|
14
|
+
handleTabChange: (tabId: string) => void;
|
|
15
|
+
handleMouseEnter: () => void;
|
|
16
|
+
handleMouseLeave: () => void;
|
|
17
|
+
handleClose: () => void;
|
|
18
|
+
handleSearch: (newSearchTerm: string) => void;
|
|
19
|
+
setIsAnimating: Dispatch<SetStateAction<boolean>>;
|
|
20
|
+
setSearchIsExpanded: Dispatch<SetStateAction<boolean>>;
|
|
21
|
+
}
|
|
22
|
+
export declare function useToolbarState(): UseToolbarStateReturn;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './toolbar';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type TabId = 'flags' | 'settings';
|
|
2
|
+
export type ActiveTabId = TabId | undefined;
|
|
3
|
+
export declare const TAB_ORDER: readonly TabId[];
|
|
4
|
+
export interface FeatureFlag {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
custom: boolean;
|
|
9
|
+
description?: string;
|
|
10
|
+
lastModified?: Date;
|
|
11
|
+
environment?: string;
|
|
12
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@launchdarkly/toolbar",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "A React component that provides a developer-friendly toolbar for interacting with LaunchDarkly during development",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"launchdarkly",
|
|
7
|
+
"feature-flags",
|
|
8
|
+
"react",
|
|
9
|
+
"toolbar",
|
|
10
|
+
"development",
|
|
11
|
+
"typescript"
|
|
12
|
+
],
|
|
13
|
+
"type": "module",
|
|
14
|
+
"license": "Apache-2.0",
|
|
15
|
+
"author": "Catamorphic Co.",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/launchdarkly/launchpad-ui.git"
|
|
19
|
+
},
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/launchdarkly/launchpad-ui/issues"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://github.com/launchdarkly/launchpad-ui#readme",
|
|
24
|
+
"main": "./dist/js/index.js",
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"import": "./dist/js/index.js"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist"
|
|
34
|
+
],
|
|
35
|
+
"browserslist": [
|
|
36
|
+
"last 2 versions",
|
|
37
|
+
"not dead",
|
|
38
|
+
"not IE 11"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "rslib build && node scripts/fix-base-url.cjs",
|
|
42
|
+
"build:storybook": "storybook build",
|
|
43
|
+
"dev": "rslib build --watch",
|
|
44
|
+
"release": "pnpm build && npm publish",
|
|
45
|
+
"demo": "pnpm build && pnpm --filter launchdarkly-toolbar-demo dev",
|
|
46
|
+
"demo:dev": "pnpm --filter launchdarkly-toolbar-demo dev",
|
|
47
|
+
"demo:build": "pnpm build && pnpm --filter launchdarkly-toolbar-demo build",
|
|
48
|
+
"format": "prettier --write .",
|
|
49
|
+
"storybook": "storybook dev -p 6006",
|
|
50
|
+
"test": "vitest run",
|
|
51
|
+
"test:e2e:ci": "TEST_ENV=ci playwright test --config=./e2e/playwright.config.ts",
|
|
52
|
+
"test:e2e:local": "TEST_ENV=local playwright test --config=./e2e/playwright.config.ts",
|
|
53
|
+
"test:e2e:local:ui": "TEST_ENV=local playwright test --ui --config=./e2e/playwright.config.ts",
|
|
54
|
+
"test:e2e:ci:ui": "TEST_ENV=ci playwright test --ui --config=./e2e/playwright.config.ts",
|
|
55
|
+
"lint": "oxlint"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@playwright/test": "^1.53.1",
|
|
59
|
+
"@rsbuild/core": "1.4.12",
|
|
60
|
+
"@rsbuild/plugin-react": "^1.3.4",
|
|
61
|
+
"@rslib/core": "^0.11.1",
|
|
62
|
+
"@storybook/addon-docs": "^9.0.5",
|
|
63
|
+
"@storybook/addon-essentials": "^9.0.0-alpha.12",
|
|
64
|
+
"@storybook/addon-interactions": "^9.0.0-alpha.10",
|
|
65
|
+
"@storybook/addon-links": "^9.0.5",
|
|
66
|
+
"@storybook/addon-onboarding": "^9.0.5",
|
|
67
|
+
"@storybook/blocks": "^9.0.0-alpha.17",
|
|
68
|
+
"@storybook/react": "^9.0.5",
|
|
69
|
+
"@storybook/test": "^9.0.0-alpha.2",
|
|
70
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
71
|
+
"@testing-library/react": "^16.3.0",
|
|
72
|
+
"@types/node": "^24.0.4",
|
|
73
|
+
"@types/react": "^19.1.6",
|
|
74
|
+
"@vanilla-extract/vite-plugin": "^5.1.1",
|
|
75
|
+
"http-server": "^14.1.1",
|
|
76
|
+
"jsdom": "^26.1.0",
|
|
77
|
+
"oxlint": "^1.0.0",
|
|
78
|
+
"prettier": "^3.5.3",
|
|
79
|
+
"react": "^19.1.0",
|
|
80
|
+
"storybook": "^9.0.5",
|
|
81
|
+
"storybook-addon-rslib": "^2.0.0",
|
|
82
|
+
"storybook-react-rsbuild": "^2.0.0",
|
|
83
|
+
"typescript": "^5.8.3",
|
|
84
|
+
"vitest": "^3.2.2"
|
|
85
|
+
},
|
|
86
|
+
"peerDependencies": {
|
|
87
|
+
"react": ">=16.9.0",
|
|
88
|
+
"react-dom": ">=16.9.0"
|
|
89
|
+
},
|
|
90
|
+
"private": false,
|
|
91
|
+
"dependencies": {
|
|
92
|
+
"@launchpad-ui/components": "^0.10.0",
|
|
93
|
+
"@launchpad-ui/core": "^0.56.10",
|
|
94
|
+
"@launchpad-ui/tokens": "^0.12.6",
|
|
95
|
+
"@tanstack/react-virtual": "^3.13.12",
|
|
96
|
+
"@vanilla-extract/css": "^1.17.4",
|
|
97
|
+
"@vanilla-extract/webpack-plugin": "^2.3.22",
|
|
98
|
+
"motion": "^12.19.2"
|
|
99
|
+
}
|
|
100
|
+
}
|