@k8slens/lds-carousel 0.23.0 → 0.23.2

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.
Files changed (3) hide show
  1. package/README.md +42 -19
  2. package/llms.txt +68 -0
  3. package/package.json +8 -7
package/README.md CHANGED
@@ -1,14 +1,22 @@
1
- # Lens Design System – React Carousel component
1
+ # @k8slens/lds-carousel
2
2
 
3
- ## Documentation
4
- Browse the documentation at [lens-design-system.k8slens.dev](https://lens-design-system.k8slens.dev/?path=/docs/carousel).
3
+ Carousel component for the Lens Design System – auto-playing slide carousel with dot navigation.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @k8slens/lds-carousel @k8slens/lds-tokens
9
+ ```
10
+
11
+ ## Setup
5
12
 
6
- ## Usage in React apps
7
- - run `npm i -s @k8slens/lds @k8slens/lds-tokens @k8slens/lds-carousel`
8
- - import `@k8slens/lds-tokens/lib/es/font-imports.css` in your React app to include fonts
9
- - import `@k8slens/lds/lib/es/index.css` in your React app to include core styles
10
- - import `@k8slens/lds-carousel/lib/es/index.css` in your React app to include Carousel styles
11
- - Use in a component:
13
+ ```tsx
14
+ import "@k8slens/lds-tokens/lib/electron/font-face.css";
15
+ import "@k8slens/lds/lib/es/index.css";
16
+ import "@k8slens/lds-carousel/lib/es/index.css";
17
+ ```
18
+
19
+ ## Usage
12
20
 
13
21
  ```tsx
14
22
  import Carousel from "@k8slens/lds-carousel";
@@ -22,9 +30,12 @@ export const Component = () => (
22
30
  );
23
31
  ```
24
32
 
25
- ### Autoplay first slide when it's a video
33
+ ### Video Autoplay
34
+
35
+ To autoplay a video on the first slide:
36
+
26
37
  ```tsx
27
- import Carousel from "@k8slens/lds-carousel";
38
+ import { Carousel } from "@k8slens/lds-carousel";
28
39
 
29
40
  export const Component = () => {
30
41
  const videoRef = React.useRef<HTMLVideoElement>(null);
@@ -34,19 +45,17 @@ export const Component = () => {
34
45
 
35
46
  useEffect(() => {
36
47
  if (videoRef?.current && playing && !isVideoPlaying) {
37
- videoRef.current.play().catch((e) => {
38
- console.log(e);
39
- });
48
+ videoRef.current.play().catch(console.log);
40
49
  }
41
50
  }, [videoRef, playing, isVideoPlaying]);
42
51
 
43
52
  return (
44
- <Carousel>
53
+ <Carousel isVideoPlaying={isVideoPlaying} setVideoPlaying={setVideoPlaying}>
45
54
  <video
46
- key="video-1" // Key needs to include the word "video"
55
+ key="video-1" // Key must include "video"
47
56
  ref={videoRef}
48
57
  autoPlay={playing}
49
- src="src"
58
+ src="video.mp4"
50
59
  muted // Mute video to avoid autoplay issues
51
60
  onPlay={() => setIsVideoPlaying(true)}
52
61
  onPause={() => setIsVideoPlaying(false)}
@@ -57,5 +66,19 @@ export const Component = () => {
57
66
  <img src="src" alt="Alt text" />
58
67
  </Carousel>
59
68
  );
60
- }
61
- ```
69
+ };
70
+ ```
71
+
72
+ ## Documentation
73
+
74
+ Browse examples at [lens-design-system.k8slens.dev](https://lens-design-system.k8slens.dev/?path=/docs/carousel).
75
+
76
+ ## AI Assistance
77
+
78
+ This package includes an `llms.txt` file with API documentation optimized for LLMs. Add to your project's AI configuration (e.g., `CLAUDE.md`):
79
+
80
+ ```markdown
81
+ Read node_modules/@k8slens/lds-carousel/llms.txt for carousel API reference.
82
+
83
+ Use the LDS Carousel component instead of custom implementations.
84
+ ```
package/llms.txt ADDED
@@ -0,0 +1,68 @@
1
+ # @k8slens/lds-carousel
2
+
3
+ > Carousel component for the Lens Design System - auto-playing slide carousel with dot navigation.
4
+
5
+ Built on Embla Carousel with autoplay support.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @k8slens/lds-carousel @k8slens/lds-tokens
11
+ ```
12
+
13
+ ### Peer Dependencies
14
+
15
+ ```bash
16
+ npm install react react-dom clsx
17
+ ```
18
+
19
+ ## Setup
20
+
21
+ Import required styles in your app entry point:
22
+
23
+ ```tsx
24
+ import "@k8slens/lds-tokens/lib/electron/font-face.css";
25
+ import "@k8slens/lds/lib/es/index.css";
26
+ import "@k8slens/lds-carousel/lib/es/index.css";
27
+ ```
28
+
29
+ ## Usage
30
+
31
+ ```tsx
32
+ import { Carousel } from "@k8slens/lds-carousel";
33
+
34
+ <Carousel>
35
+ <div>Slide 1</div>
36
+ <div>Slide 2</div>
37
+ <div>Slide 3</div>
38
+ </Carousel>
39
+ ```
40
+
41
+ ## Props
42
+
43
+ | Prop | Type | Description |
44
+ |------|------|-------------|
45
+ | `isVideoPlaying` | `boolean` | Control video autoplay state |
46
+ | `setVideoPlaying` | `(playing: boolean) => void` | Callback for video state changes |
47
+ | `className` | `string` | Additional CSS classes |
48
+ | `children` | `ReactNode` | Slide content |
49
+
50
+ ## Features
51
+
52
+ - Auto-advances every 8 seconds
53
+ - Loop navigation
54
+ - Dot indicators
55
+ - Stops on user interaction
56
+ - Video autoplay integration
57
+
58
+ ## Dependencies
59
+
60
+ This package depends on `@k8slens/lds` core components and Embla Carousel.
61
+
62
+ ## Documentation
63
+
64
+ - [Lens Design System](https://lens-design-system.k8slens.dev/)
65
+
66
+ ## Optional
67
+
68
+ - [npm Package](https://www.npmjs.com/package/@k8slens/lds-carousel)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k8slens/lds-carousel",
3
- "version": "0.23.0",
3
+ "version": "0.23.2",
4
4
  "description": "Lens Design System – React Carousel component",
5
5
  "author": "Mirantis Inc",
6
6
  "license": "MIT",
@@ -15,7 +15,8 @@
15
15
  "types": "./lib/es/index.d.ts",
16
16
  "type": "module",
17
17
  "files": [
18
- "lib/"
18
+ "lib/",
19
+ "llms.txt"
19
20
  ],
20
21
  "scripts": {
21
22
  "start": "npm run rollup-watch",
@@ -23,16 +24,16 @@
23
24
  "rollup-watch": "rollup -c --watch --waitForBundleInput",
24
25
  "rollup": "rollup -c",
25
26
  "clean": "rimraf lib",
26
- "lint": "eslint .",
27
- "format": "eslint --fix ."
27
+ "lint": "oxlint .",
28
+ "format": "oxlint --fix . && prettier --write ."
28
29
  },
29
30
  "dependencies": {
30
- "@k8slens/lds": "^0.57.0",
31
+ "@k8slens/lds": "^0.57.2",
31
32
  "embla-carousel-autoplay": "8.0.0-rc11",
32
33
  "embla-carousel-react": "8.0.0-rc11"
33
34
  },
34
35
  "devDependencies": {
35
- "@k8slens/lds-tokens": "^0.58.0",
36
+ "@k8slens/lds-tokens": "^0.58.2",
36
37
  "@rollup/plugin-node-resolve": "15.0.2",
37
38
  "@storybook/react": "6.5.16",
38
39
  "@testing-library/react": "14.0.0",
@@ -55,5 +56,5 @@
55
56
  "\\.svg": "<rootDir>/../../__mocks__/SVGStub.js"
56
57
  }
57
58
  },
58
- "gitHead": "dc375594fe63bf08745b6cfa09c4dc8437a4dc03"
59
+ "gitHead": "1edf9b6761a700920be41adb01f3de528320f639"
59
60
  }