|
| 1 | +/** |
| 2 | + * Copyright IBM Corp. 2025 |
| 3 | + * |
| 4 | + * This source code is licensed under the Apache-2.0 license found in the |
| 5 | + * LICENSE file in the root directory of this source tree. |
| 6 | + */ |
| 7 | +import figma, { html } from '@figma/code-connect/html'; |
| 8 | + |
| 9 | +figma.connect( |
| 10 | + 'https://www.figma.com/design/0F9dKH2abAd7gSfvnacfWf/-v11--IBM-Products-%E2%80%93-Carbon-Design-System?node-id=16334-6720', |
| 11 | + { |
| 12 | + props: { |
| 13 | + kind: figma.enum('Type', { |
| 14 | + Custom: 'custom', |
| 15 | + '403 – Access denied': '403', |
| 16 | + '404 – Page not found': '404', |
| 17 | + }), |
| 18 | + baseProps: figma.nestedProps('_FP error content base', { |
| 19 | + label: figma.enum('Type', { |
| 20 | + Custom: figma.string('Error code'), |
| 21 | + '403': 'Error 403', |
| 22 | + '404': 'Error 404', |
| 23 | + '408': 'Error 408', |
| 24 | + '500': 'Error 500', |
| 25 | + '502': 'Error 502', |
| 26 | + '503': 'Error 503', |
| 27 | + '504': 'Error 504', |
| 28 | + }), |
| 29 | + |
| 30 | + title: figma.enum('Type', { |
| 31 | + Custom: figma.string('Title text'), |
| 32 | + '403': 'Access denied', |
| 33 | + '404': 'Page not found', |
| 34 | + '408': 'Request time-out', |
| 35 | + '500': 'Internal server error', |
| 36 | + '502': 'Bad gateway', |
| 37 | + '503': 'Service unavailable', |
| 38 | + '504': 'Gateway timeout', |
| 39 | + }), |
| 40 | + description: figma.enum('Type', { |
| 41 | + Custom: figma.string('Description'), |
| 42 | + '403': |
| 43 | + 'You are not authorized to access the requested page. Please verify that you are logged in to the hosting environment and your access permissions are correct.', |
| 44 | + '404': |
| 45 | + 'The page you requested has moved or is unavailable, or the specified URL is not valid. Please check the URL or search the site for the requested content.', |
| 46 | + '408': |
| 47 | + 'The server fails to complete a request within the given time due to increased network activity causing delays.', |
| 48 | + '500': 'A general error message for undefined server-side issues.', |
| 49 | + '502': |
| 50 | + 'A gateway or proxy server receives an invalid response from an upstream server.', |
| 51 | + '503': |
| 52 | + 'A gateway or proxy server receives an invalid response from an upstream server.', |
| 53 | + '504': |
| 54 | + "The server doesn't receive a response from another server within the specified time period.", |
| 55 | + }), |
| 56 | + children: figma.children('Link'), |
| 57 | + }), |
| 58 | + }, |
| 59 | + example: (props) => |
| 60 | + html`<c4p-full-page-error |
| 61 | + kind=${props.kind} |
| 62 | + description=${props.baseProps.description} |
| 63 | + label=${props.baseProps.label} |
| 64 | + title=${props.baseProps.title} |
| 65 | + > |
| 66 | + ${props.baseProps.children} |
| 67 | + </c4p-full-page-error>`, |
| 68 | + imports: [ |
| 69 | + "import '@carbon/ibm-products-web-components/es/components/full-page-error/index.js'", |
| 70 | + ], |
| 71 | + } |
| 72 | +); |
0 commit comments